if (tactile == null || typeof (tactile) != "object") {
	var tactile = {};
	tactile.version = "beta.0.3-201112071540";
}
if (tactile.c == null || typeof (tactile.c) != "object") {
	tactile.c = {};
}
if (!Array.prototype.indexOf) {
	Array.prototype.indexOf = function(c, d) {
		var a, b = d || 0;
		for (a = b; a < this.length; ++a) {
			if (this[a] === c) {
				return a;
			}
		}
		return -1;
	};
}
if (!Array.prototype.contains) {
	Array.prototype.contains = function(b) {
		for ( var a = 0; a < this.length; a++) {
			if (this[a] === b) {
				return true;
			}
		}
		return false;
	};
}
if (!Array.prototype.forEach) {
	Array.prototype.forEach = function(c, d) {
		var a, b = d || window;
		for (a = 0, j = this.length; a < j; ++a) {
			c.call(b, this[a], a, this);
		}
	};
}
if (!Array.prototype.every) {
	Array.prototype.every = function(c, d) {
		var a, b = d || window;
		for (a = 0, j = this.length; a < j; ++a) {
			if (!c.call(b, this[a], a, this)) {
				return false;
			}
		}
		return true;
	};
}
if (!Array.prototype.some) {
	Array.prototype.some = function(c, d) {
		var a, b = d || window;
		for (a = 0, j = this.length; a < j; ++a) {
			if (c.call(b, this[a], a, this)) {
				return true;
			}
		}
		return false;
	};
}
if (!Array.prototype.map) {
	Array.prototype.map = function(e, f) {
		var c, b = [], d = f || window;
		for (c = 0, j = this.length; c < j; ++c) {
			b.push(e.call(d, this[c], c, this));
		}
		return b;
	};
}
if (!Array.prototype.filter) {
	Array.prototype.filter = function(f, g) {
		var d, c = this.length, b = [], e = g || window;
		for (d = 0; d < c; ++d) {
			if (!f.call(e, this[d], d, this)) {
				continue;
			}
			b.push(this[d]);
		}
		return b;
	};
}
if (!Array.prototype.lastIndexOf) {
	Array.prototype.lastIndexOf = function(c, d) {
		var a, b = d || this.length;
		if (b >= this.length) {
			b = this.length;
		}
		if (b < 0) {
			b = this.length + d;
		}
		for (a = b; a >= 0; --a) {
			if (this[a] === c) {
				return a;
			}
		}
		return -1;
	};
}
if (!Array.prototype.remove) {
	Array.prototype.remove = function(a) {
		var b = this.indexOf(a);
		if (b != -1) {
			this.splice(b, 1);
		}
	};
}
document.getElementsByAttribute = function(c, g, b, a) {
	var e = [];
	if (b == null) {
		b = this;
	}
	if (a == null) {
		a = "*";
	}
	var d = b.getElementsByTagName(a);
	for ( var f = 0; f < d.length; f++) {
		if (d[f].hasAttribute(c)) {
			if (g) {
				if (d[f].getAttribute(c) == g) {
					e.push(d[f]);
				}
			} else {
				e.push(d[f]);
			}
		}
	}
	return e;
};
document.getFirstBodyChild = function() {
	var a = document.body;
	if (a.firstElementChild) {
		return a.firstElementChild;
	}
	if (a.firstChild && a.firstChild.nodeType === 1) {
		return a.firstChild;
	}
	return undefined;
};
document.getElementsByClassName = function(o, n) {
	var c;
	var d = [];
	var k, h;
	var g;
	var e = "";
	var f = [];
	var b = "";
	var l = "";
	var a = o.split(",");
	var m = document;
	if (n && n != null) {
		m = n;
	}
	if (m.querySelectorAll) {
		if (a && a.length > 1) {
			for (k = 0; k < a.length; k++) {
				if (k > 0) {
					l = ",";
				}
				b += l + "." + a[k];
			}
			d = m.querySelectorAll(b);
		} else {
			d = m.querySelectorAll("." + o);
		}
	} else {
		c = m.getElementsByTagName("*");
		for (k = 0; k < c.length; k++) {
			g = c[k];
			if (g.className) {
				f = g.className.split(" ");
				for (h = 0; h < f.length; h++) {
					if (a.length > 1) {
						if (a.contains(f[h])) {
							d[d.length] = g;
							break;
						}
					} else {
						if (f[h] === o) {
							d[d.length] = g;
						}
					}
				}
			}
		}
	}
	return d;
};
document.getAll = function(g) {
	var a = new Array();
	var h = g.split(",");
	var d, e, b;
	var f = "";
	d = "";
	for ( var c = 0; c < h.length; c++) {
		if (h[c].indexOf(".") == 0) {
			b = new Array();
			if (document.querySelectorAll) {
				b = document.querySelectorAll(h[c]);
				for ( var c = 0; c < b.length; c++) {
					a.push(b[c]);
				}
			} else {
				if (d != "") {
					f = ",";
				}
				d += f + h[c].substr(1);
			}
		} else {
			if (h[c].indexOf("#") == 0) {
				if (document.querySelector) {
					b = document.querySelector(h[c]);
				} else {
					b = document.getElementById(h[c].substr(1));
				}
				if (b && b != null) {
					a.push(b);
				}
			}
		}
	}
	if (d != "") {
		b = document.getElementsByClassName(d);
		if (b && b.length > 0) {
			for ( var c = 0; c < b.length; c++) {
				a.push(b[c]);
			}
		}
	}
	return a;
};
if (!Function.prototype.bind) {
	Function.prototype.bind = function(b) {
		var a = this;
		return function() {
			return a.apply(b, arguments);
		};
	};
}
if (!String.prototype.ltrim) {
	String.prototype.ltrim = function(a) {
		a = a || "\\s";
		return this.replace(new RegExp("^[" + a + "]+", "g"), "");
	};
}
if (!String.prototype.rtrim) {
	String.prototype.rtrim = function(a) {
		a = a || "\\s";
		return this.replace(new RegExp("[" + a + "]+$", "g"), "");
	};
}
if (!String.prototype.trim) {
	String.prototype.trim = function(a) {
		return this.ltrim(a).rtrim(a);
	};
}
tactile.c.C = {};
tactile.c.C.getCookie = function(c) {
	if (document.cookie.length > 0) {
		var a = document.cookie.indexOf(c + "=");
		if (a !== -1) {
			a = a + c.length + 1;
			var b = document.cookie.indexOf(";", a);
			if (b === -1) {
				b = document.cookie.length;
			}
			return unescape(document.cookie.substring(a, b));
		}
	}
	return "";
};
tactile.c.C.setCookie = function(d, c, a) {
	var b = new Date();
	b.setDate(b.getDate() + a);
	document.cookie = d + "=" + escape(c)
			+ ((a === null) ? "" : ";expires=" + b.toGMTString());
};
tactile.c.C.deleteCookie = function(a) {
	if (this.getCookie(a)) {
		document.cookie = a + "=; expires=Thu, 01-Jan-70 00:00:01 GMT;";
	}
};
tactile.c.D = {
	os : (function() {
		var g = {};
		g.platform = "unknown";
		g.version = 0;
		g.isTouch = c();
		if (window.navigator) {
			var b = [ {
				id : "android",
				ver : "android[/|\\s]([0-9].[0-9])"
			}, {
				id : "bada",
				ver : "bada/([0-9])"
			}, {
				id : "webos",
				ver : "webos/([0-9].[0-9])"
			}, {
				id : "blackberry",
				ver : "blackberry[0-9]{4}?/([0-9].[0-9])"
			} ];
			var h = [ {
				id : "iphone",
				ver : "iphone os ([0-9])"
			}, {
				id : "ipod",
				ver : "os ([0-9])"
			}, {
				id : "ipad",
				ver : "os ([0-9])"
			}, {
				id : "mac",
				ver : null
			}, {
				id : "win",
				ver : null
			} ];
			var f = window.navigator.userAgent.toLowerCase();
			for ( var e = 0; e < b.length; e++) {
				if (f.indexOf(b[e].id) != -1) {
					g.platform = b[e].id;
					if (b[e].ver !== null && f.match(RegExp(b[e].ver)) != -1) {
						g.version = RegExp.$1;
					}
					break;
				}
			}
			if (g.platform == "unknown") {
				var a = window.navigator.platform.toLowerCase();
				for ( var d = 0; d < h.length; d++) {
					if (a.indexOf(h[d].id) != -1) {
						if (h[d].id === "iphone" || h[d].id === "ipod"
								|| h[d].id === "ipad") {
							g.platform = "ios";
						}
						if (h[d].ver !== null
								&& f.match(RegExp(h[d].ver)) != -1) {
							g.version = RegExp.$1;
						}
						break;
					}
				}
				if (g.platform == "unknown") {
					g.platform = a;
				}
			}
		}
		function c() {
			if (typeof nbdevice === "object" && nbdevice.tactiletouchapi) {
				return (nbdevice.tactiletouchapi == "Touch");
			}
			try {
				document.createEvent("TouchEvent");
				return true;
			} catch (i) {
				return false;
			}
		}
		return g;
	})(),
	browser : (function() {
		var m = {}, c = {}, p = document.createElement("feature"), i = p.style, g = {
			webkit : "-webkit-",
			opera : "-o-",
			netfront : "",
			firefox : "-moz-",
			iemobile : "-ms-",
			msie : "-ms"
		};
		cssborderradius = "cssborderradius";
		cssanimations = "cssanimations", csstransitions = "csstransitions",
				csstransforms = "csstransforms",
				csstransforms3d = "csstransforms3d";
		m.style = {};
		m.cssprefix = "";
		m.name = "unknown";
		m.transitionEndEvent = "";
		var n = tactile.c.C.getCookie("emvcc");
		m.canCookie = (n == "") ? false : true;
		if (window.navigator) {
			var l = [ "webkit", "opera", "netfront", "firefox", "iemobile",
					"msie" ];
			var a = window.navigator.userAgent.toLowerCase();
			for ( var d = 0; d < l.length; d++) {
				if (a.indexOf(l[d]) != -1) {
					m.name = l[d];
					m.cssprefix = g[m.name];
				}
			}
		}
		var o = ({}).hasOwnProperty, q;
		if (typeof o !== "undefined" && typeof o.call !== "undefined") {
			q = function(k, f) {
				return o.call(k, f);
			};
		} else {
			q = function(k, f) {
				return ((f in k) && typeof k.constructor.prototype[f] === "undefined");
			};
		}
		function h(r, k) {
			for ( var f in k) {
				if (i[k[f]] !== undefined) {
					m.style[r] = k[f];
					return true;
				}
			}
		}
		function b(r) {
			var k = r.charAt(0).toUpperCase() + r.substr(1), f = [ r,
					"Webkit" + k, "Moz" + k, "O" + k, "ms" + k ];
			return !!h(r, f);
		}
		c[cssborderradius] = function() {
			return b("borderRadius");
		};
		c[cssanimations] = function() {
			return b("animationName");
		};
		c[csstransitions] = function() {
			if (b("transitionProperty")) {
				b("transitionDuration");
				b("transitionTimingFunction");
				b("transitionDelay");
				return true;
			} else {
				return false;
			}
		};
		c[csstransforms] = function() {
			return !!h("transformProperty", [ "WebkitTransform",
					"MozTransform", "OTransform", "msTransform" ]);
		};
		c[csstransforms3d] = function() {
			var f = !!h("perspectiveProperty", [ "WebkitPerspective",
					"MozPerspective", "OPerspective", "msPerspective" ]);
			return f;
		};
		for ( var e in c) {
			if (q(c, e)) {
				m[e.toLowerCase()] = c[e]();
			}
		}
		p = null;
		return m;
	})(),
	screen : {
		getWidth : function() {
			if (typeof netbiscuits !== "undefined"
					&& netbiscuits.screen !== "undefined"
					&& netbiscuits.screen.resizeEvent !== "undefined") {
				return netbiscuits.screen.getWidth();
			} else {
				var a = 320;
				if (tactile.c.D.browser.name === "webkit") {
					a = document.documentElement.clientWidth;
				} else {
					if (typeof (window.innerWidth) == "number") {
						a = window.innerWidth;
					} else {
						if (document.documentElement
								&& (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
							a = document.documentElement.clientWidth;
						} else {
							if (document.body
									&& (document.body.clientWidth || document.body.clientHeight)) {
								a = document.body.clientWidth;
							} else {
								if (window.screen.availWidth) {
									a = window.screen.availWidth;
								}
							}
						}
					}
				}
				return a;
			}
		},
		getHeight : function() {
			if (typeof netbiscuits !== "undefined"
					&& netbiscuits.screen !== "undefined"
					&& netbiscuits.screen.resizeEvent !== "undefined") {
				return netbiscuits.screen.getHeight();
			} else {
				var a = 480;
				if (tactile.c.D.browser.name === "webkit") {
					a = document.documentElement.clientHeight;
				} else {
					if (typeof (window.innerWidth) == "number") {
						a = window.innerHeight;
					} else {
						if (document.documentElement
								&& (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
							a = document.documentElement.clientHeight;
						} else {
							if (document.body
									&& (document.body.clientWidth || document.body.clientHeight)) {
								a = document.body.clientHeight;
							} else {
								if (window.screen.availWidth) {
									a = window.screen.availHeight;
								}
							}
						}
					}
				}
				return a;
			}
		},
		updateOrientation : function() {
			if (tactile.c.D.screen.getHeight() > tactile.c.D.screen.getWidth()) {
				document.body.className = "portrait";
			} else {
				document.body.className = "landscape";
			}
		}
	}
};
setTimeout(
		function() {
			if (window.addEventListener) {
				var b = document.createElement("div");
				var a = function(c) {
					tactile.c.D.browser.transitionEndEvent = c.type;
					this.removeEventListener("webkitTransitionEnd",
							arguments.callee);
					this
							.removeEventListener("OTransitionEnd",
									arguments.callee);
					this.removeEventListener("transitionend", arguments.callee);
					this.removeEventListener("transitionEnd", arguments.callee);
				};
				b
						.setAttribute(
								"style",
								"position:absolute;top:0px;transition:top 1ms ease;-webkit-transition:top 1ms ease;-moz-transition:top 1ms ease;-o-transition:top 1ms ease");
				b.addEventListener("webkitTransitionEnd", a, false);
				b.addEventListener("OTransitionEnd", a, false);
				b.addEventListener("transitionend", a, false);
				b.addEventListener("transitionEnd", a, false);
				document.documentElement.appendChild(b);
				setTimeout(function() {
					b.style.top = "100px";
					setTimeout(function() {
						b.parentNode.removeChild(b);
						b = a = null;
					}, 100);
				}, 0);
			}
		}, 10);
tactile.c.E = {
	isHTMLElement : function(a) {
		if (typeof HTMLElement === "object") {
			return (a instanceof HTMLElement || (a.nodeType && a.nodeType == 1));
		} else {
			if (a.nodeType && a.nodeType == 1) {
				return true;
			}
		}
		return false;
	},
	getOffsetLeft : function(b) {
		var a = 0;
		if (b.offsetParent) {
			while (b.offsetParent) {
				a += b.offsetLeft;
				b = b.offsetParent;
			}
		} else {
			if (b.x) {
				a += b.x;
			}
		}
		return a;
	},
	getOffsetTop : function(b) {
		var a = 0;
		if (b.offsetParent) {
			while (b.offsetParent) {
				a += b.offsetTop;
				b = b.offsetParent;
			}
		} else {
			if (b.y) {
				a += b.y;
			}
		}
		return a;
	},
	getChildByTagname : function(a, c) {
		if (c) {
			if (a.getElementsByTagName) {
				var b = a.getElementsByTagName(c);
				if (b && b.length > 0) {
					return b[0];
				}
			}
		}
	},
	getTagName : function(b) {
		var a;
		a = b.tagName;
		if (!a) {
			a = b.nodeName;
		}
		if (a.toUpperCase) {
			a = a.toUpperCase();
		}
		return a;
	},
	addClass : function(d, c) {
		var a, b;
		a = d.className;
		b = a.split(" ");
		if (a && a.length > 0) {
			b = a.split(" ");
			if (!b.contains(c)) {
				d.className = a + " " + c;
			}
		} else {
			d.className = c;
		}
		return d.className;
	},
	removeClass : function(e, d) {
		var a, c, f;
		a = e.className;
		c = a.split(" ");
		f = "";
		for ( var b = 0; b < c.length; b++) {
			if (c[b] != d) {
				if (f.length > 0) {
					f += " " + c[b];
				} else {
					f += c[b];
				}
			}
		}
		if (f.length > 0) {
			e.className = f;
		} else {
			e.removeAttribute("class");
		}
		return e.className;
	},
	getCurrStyle : function(a, c) {
		if (a.currentStyle) {
			return a.currentStyle[c];
		} else {
			if (window.getComputedStyle) {
				var b;
				b = window.getComputedStyle(a, false);
				if (b == null) {
					b = window.getComputedStyle(a, null);
				}
				if (tactile.c.D.browser.name === "webkit"
						&& c === "margin-right") {
					return b.getPropertyValue("margin-left");
				}
				return b.getPropertyValue(c);
			} else {
				if (document.defaultView
						&& document.defaultView.getComputedStyle) {
					return document.defaultView.getComputedStyle(a, "")[c];
				} else {
					return a.style[c];
				}
			}
		}
	},
	getStyleValue : function(d, e) {
		var c, b, a;
		a = 0;
		c = tactile.c.E.getCurrStyle(d, e);
		if (c !== undefined) {
			b = c.indexOf("px");
			if (b > -1) {
				a += Number(c.substring(0, b));
			}
		}
		return a;
	},
	getHorizontalMargin : function(c) {
		var b, a, e, d;
		e = 0;
		b = tactile.c.E.getCurrStyle(c, "margin-left");
		if (b !== undefined) {
			a = b.indexOf("px");
			if (a > -1) {
				e += Number(b.substring(0, a));
			}
		}
		b = tactile.c.E.getCurrStyle(c, "margin-right");
		if (b !== undefined) {
			a = b.indexOf("px");
			if (a > -1) {
				e += Number(b.substring(0, a));
			}
		}
		return e;
	},
	getVerticalMargin : function(c) {
		var b, a, e, d;
		e = 0;
		b = tactile.c.E.getCurrStyle(c, "margin-top");
		if (b !== undefined) {
			a = b.indexOf("px");
			if (a > -1) {
				e += Number(b.substring(0, a));
			}
		}
		b = tactile.c.E.getCurrStyle(c, "margin-bottom");
		if (b !== undefined) {
			a = b.indexOf("px");
			if (a > -1) {
				e += Number(b.substring(0, a));
			}
		}
		return e;
	},
	getOffsetMarginLeft : function(b) {
		var a = 0;
		if (b.offsetParent) {
			while (b.offsetParent) {
				a += tactile.c.E.getStyleValue(b, "margin-left")
						+ tactile.c.E.getStyleValue(b, "border-left-width");
				b = b.offsetParent;
			}
		}
		return a;
	},
	setOpacity : function(b, a) {
		if (b.style.opacity != undefined) {
			b.style.opacity = (a / 100);
		} else {
			if (b.style.MozOpacity != undefined) {
				b.style.MozOpacity = (a / 100);
			} else {
				if (b.style.KhtmlOpacity != undefined) {
					b.style.KhtmlOpacity = (a / 100);
				} else {
					if (b.style.filter != undefined) {
						b.style.filter = "alpha(opacity=" + a + ")";
					}
				}
			}
		}
	},
	getOpacity : function(b) {
		if (b.style.opacity != undefined) {
			return (Number(b.style.opacity) * 100);
		} else {
			if (b.style.MozOpacity != undefined) {
				return (Number(b.style.MozOpacity) * 100);
			} else {
				if (b.style.KhtmlOpacity != undefined) {
					return (Number(b.style.KhtmlOpacity) * 100);
				} else {
					if (b.style.filter != undefined) {
						var c, a;
						c = b.style.filter;
						a = parseInt(c.replace(")", "").replace(
								"alpha(opacity=", "")) / 100;
						if (!isNaN(a) && a != "") {
							return a;
						}
						return "";
					}
				}
			}
		}
	},
	clear : function(c) {
		try {
			c.innerHTML = "";
		} catch (d) {
		}
		if (c.hasChildNodes()) {
			var b = c.childNodes;
			for ( var a = 0; a < b.length; a++) {
				b[a].parentNode.removeChild(b[a]);
				if (b[a]) {
					tactile.c.E.clear(b[a]);
					b[a].parentNode.removeChild(b[a]);
				}
			}
		}
	},
	setInnerHTML : function(d, c, a) {
		if (a && a === true) {
		} else {
			tactile.c.E.clear(d);
		}
		var b;
		if (typeof (HTMLElement) === "object") {
			if (d instanceof HTMLElement) {
				if (tactile.c.E.isHTMLElement(c)) {
					d.appendChild(c);
				} else {
					d.innerHTML = c;
				}
			}
		} else {
			if (d.nodeType && d.nodeType == 1) {
				if ((typeof c) == "string") {
					b = document.createTextNode(c);
					d.appendChild(c);
				} else {
					if ((typeof c) == "object") {
						if (tactile.c.E.isHTMLElement(c)) {
							d.appendChild(c);
						}
					}
				}
			}
		}
	},
	getZindex : function(c) {
		var b, a = 0;
		b = tactile.c.E.getCurrStyle(c, "z-index");
		if (Number(b)) {
			a = Number(b);
		}
		return a;
	},
	swapClass : function(e, b, a) {
		if (e && b && a) {
			var c, d;
			c = e.className;
			if (c && c.length > 0) {
				d = c.split(" ");
				if (d.contains(b)) {
					if (!d.contains(a)) {
						tactile.c.E.replaceClass(e, b, a);
					} else {
						tactile.c.E.removeClass(e, a);
					}
				} else {
					if (d.contains(a)) {
						tactile.c.E.replaceClass(e, a, b);
					}
				}
			} else {
				e.className = b;
			}
			return e.className;
		}
	},
	toggleClass : function(d, c) {
		if (d && c) {
			var a, b;
			a = d.className;
			if (a && a.length > 0) {
				b = a.split(" ");
				if (!b.contains(c)) {
					d.className = a + " " + c;
				} else {
					tactile.c.E.removeClass(d, c);
				}
			} else {
				d.className = c;
			}
			return d.className;
		}
	},
	replaceClass : function(f, b, h) {
		if (f) {
			var a, e, g, d;
			a = f.className;
			e = a.split(" ");
			g = e.indexOf(b);
			if (g != -1) {
				e[g] = h;
			}
			d = "";
			for ( var c = 0; c < e.length; c++) {
				if (d.length > 0) {
					d += " " + e[c];
				} else {
					d += e[c];
				}
			}
			if (d.length > 0) {
				f.className = d;
			} else {
				f.removeAttribute("class");
			}
			return f.className;
		}
	}
};
tactile.c.U = {
	setBodyStyle : function(a, b) {
		if (tactile.c.D.browser.name !== "msie") {
			document.body.style[a] = b;
		} else {
		}
	},
	applyTransformFlickerFix : function(a) {
		if (tactile.c.D.browser.name === "webkit") {
			a.style.webkitBackfaceVisibility = "hidden";
		}
	},
	removeTransformFlickerFix : function(a) {
		if (tactile.c.D.browser.name === "webkit") {
			a.style.webkitBackfaceVisibility = "";
		}
	},
	updateRenderTreeFix : function(b) {
		if (tactile.c.D.os.platform === "ios" && tactile.c.D.os.version <= 3) {
			var a = b.offsetWidth, a = b.offsetHeigth, a = b.offsetLeft, a = b.offsetTop;
		}
	},
	getUID : function() {
		return ((new Date()).getTime() + "" + Math
				.floor(Math.random() * 1000000)).substr(0, 18);
	}
};
tactile.c.A = {
	rootPath : null,
	getXHRObject : function() {
		var e;
		if (window.XMLHttpRequest) {
			e = new XMLHttpRequest();
		} else {
			if (window.ActiveXObject) {
				try {
					e = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (d) {
					try {
						e = new ActiveXObject("Msxml2.XMLHTTP");
					} catch (c) {
						try {
							e = new ActiveXObject("Msxml2.XMLHTTP.4.0");
						} catch (b) {
							try {
								e = new ActiveXObject("Msxml2.XMLHTTP.5.0");
							} catch (a) {
								e = undefined;
							}
						}
					}
				}
			} else {
				e = undefined;
			}
		}
		if (e != undefined) {
			e.getResponseDom = function() {
				var f, g;
				f = e.responseText;
				g = null;
				if (f && f != null) {
					g = tactile.c.O.stringToDom(f);
				} else {
					f = e.responseXML;
					if (f && f != null) {
						g = tactile.c.O.xmlToDom(f);
						if (g.nodeType != 1) {
							g = tactile.c.O.getElementNode(g);
						}
					}
				}
				return g;
			};
		}
		return e;
	},
	getRootPath : function() {
		var f, c, k, b, a, h, e, d;
		if (tactile.c.A.rootPath === null) {
			var g = null;
			if (typeof nbdevice == "object") {
				if (a !== null && h !== null) {
					if (nbdevice.internalapppath) {
						e = nbdevice.internalapppath;
					}
					if (nbdevice.rifpath) {
						d = nbdevice.rifpath;
					}
				}
			}
			if (d === null || d.length === 0) {
				d = "nbrif";
			}
			if (!(d.indexOf("http") === 0)) {
				d = e + d;
			}
			tactile.c.A.rootPath = d;
		}
		return tactile.c.A.rootPath;
	},
	initScript : function(element) {
		var refNode = (typeof element == "string") ? document
				.getElementById(element) : element;
		if (refNode) {
			var scripts = refNode.getElementsByTagName("script");
			for ( var i = 0; i < scripts.length; i++) {
				eval(scripts[i].innerHTML);
			}
		} else {
			throw "No Reference node found !";
		}
	},
	getSessionID : function() {
		if (tactile.c.D.browser.canCookie) {
			return ";jsessionid=" + tactile.c.C.getCookie("JSESSIONID");
		} else {
			var c, b, d, a;
			c = window.location.href;
			b = c.indexOf("?");
			d = c.indexOf(";jsessionid=");
			if (b > d) {
				a = c.substring(d, b);
			} else {
				a = c.substring(d);
			}
			return a;
		}
	}
};
tactile.c.O = {
	getElementNode : function(a) {
		var d;
		var c = a.childNodes;
		if (a.nodeType == 9 || a.nodeType == 10 || a.nodeType == 11) {
			for ( var b = 0; b < c.length; b++) {
				if (c[b].nodeType == 1) {
					d = c[b];
					break;
				}
			}
		} else {
			d = c[0];
		}
		return d;
	},
	stringToDom : function(d) {
		var a, e;
		e = document.createElement("div");
		e.innerHTML = d;
		if (e.childNodes.length > 0) {
			a = e.firstChild;
		} else {
			var b = new RegExp("(</?[^>]+>)", "g");
			if (!(b.test(d))) {
				var c = document.createTextNode(d);
				e.appendChild(c);
			} else {
				e = this.stringToDomParts(d);
			}
			if (e.childNodes.length > 0) {
				a = e.firstChild;
			}
		}
		return a;
	},
	stringToDomParts : function(k, f) {
		if (!f) {
			var f = document.createElement("div");
		}
		var n = new RegExp("(</?[^>]+>)", "g"), d = k.split(n), g = false, a = false, l = false;
		for ( var e = 0; e < d.length; e++) {
			if (a) {
				if (/<\/[^>]+>/.test(d[e])
						&& d[e].substring(2, d[e].length - 1) == a) {
					var c = document.createElement(a);
					if (l && l.length > 0) {
						for ( var b = 0, o = l.length; b < o; b++) {
							var h = l[b].replace(/['"]/g, "");
							c.setAttribute(h.split("=")[0].trim(),
									h.split("=")[1].trim());
						}
					}
					arguments.callee(g, c);
					f.appendChild(c);
					a = false;
					g = false;
				} else {
					g += d[e];
				}
			} else {
				if (!(n.test(d[e])) && d[e] != "") {
					f.appendChild(document.createTextNode(d[e]));
				} else {
					if (/<[^>]+>/.test(d[e])) {
						g = "";
						a = d[e].substring(1, d[e].length - 1);
						if (a.split(" ").length > 1) {
							l = a
									.match(/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?/g);
							a = a.split(" ")[0];
						}
					}
				}
			}
		}
		return f;
	},
	xmlToDom : function(e) {
		var g, f, k, h, c, a;
		if (e.nodeType == 9 || e.nodeType == 10 || e.nodeType == 11) {
			a = e.childNodes;
			for ( var d = 0; d < a.length; d++) {
				if (a[d].nodeType == 1) {
					g = a[d];
					break;
				}
			}
		} else {
			g = e;
		}
		if (g.nodeType == 1) {
			f = document.createElement(g.nodeName);
			k = g.attributes;
			if (k && k.length > 0) {
				for ( var d = 0; d < k.length; d++) {
					h = document.createAttribute(k[d].nodeName);
					h.nodeValue = k[d].nodeValue;
					f.setAttributeNode(h);
				}
			}
			if (g.hasChildNodes()) {
				a = g.childNodes;
				for ( var b = 0; b < a.length; b++) {
					f.appendChild(tactile.c.O.xmlToDom(a[b]));
				}
				return f;
			} else {
				return f;
			}
		} else {
			if (g.nodeType == 3 || g.nodeType == 4) {
				f = document.createTextNode(g.nodeValue);
				return f;
			} else {
				f = document.createTextNode("");
				return f;
			}
		}
	}
};
tactile.c.V = {
	addResizeListener : function(c, b) {
		if (typeof netbiscuits !== "undefined"
				&& netbiscuits.screen !== "undefined"
				&& netbiscuits.screen.resizeEvent !== "undefined") {
			var a = function(e, f) {
				var d = {
					screenWidth : e,
					screenHeight : f
				};
				c.call(b || c, d);
			};
			netbiscuits.screen.resizeEvent.add(a);
		} else {
			var a = function(d) {
				c.call(b || c, d);
			};
			tactile.c.V.resizeEvent.add(a);
		}
	},
	addManagedListener : function(d, e, c, b) {
		var a;
		if (e.toLowerCase().indexOf("resize") !== -1
				|| e.toLowerCase().indexOf("orientationchange") !== -1) {
			tactile.c.V.addResizeListener(c);
		} else {
			if ("domcontentloaded".indexOf(e.toLowerCase()) !== -1) {
				tactile.c.V.domReady.add(c);
			} else {
				if ("click|mousedown|mouseup|mousemove"
						.indexOf(e.toLowerCase()) !== -1) {
					a = function(f) {
						c.call(f, tactile.c.V.normalizeMouseEvent(f));
					};
				} else {
					a = function(f) {
						b = b || window;
						c.call(b, tactile.c.V.normalizeEvent(f));
					};
				}
				tactile.c.V.addListener(d, e, a);
			}
		}
	},
	addListener : function(b, c, a) {
		if (b.addEventListener) {
			tactile.c.V.addListner = function(e, f, d) {
				e.addEventListener(f, d, false);
			};
		} else {
			throw "browser do not support addEventListener";
		}
		tactile.c.V.addListner(b, c, a);
	},
	removeManagedListener : function(c, d, b) {
		var a;
		if ("click|mousedown|mouseup|mousemove".indexOf(d.toLowerCase()) !== -1) {
			a = function(f) {
				b.call(f, tactile.c.V.normalizeMouseEvent(f));
			};
		} else {
			a = function(f) {
				b.call(f, tactile.c.V.normalizeEvent(f));
			};
		}
		tactile.c.V.removeListener(c, d, a);
	},
	removeListener : function(b, c, a) {
		if (b.addEventListener) {
			tactile.c.V.removeListener = function(e, f, d) {
				e.removeEventListener(f, d, false);
			};
		} else {
			throw "browser do not support addEventListener";
		}
		tactile.c.V.removeListener(b, c, a);
	},
	normalizeEvent : function(b) {
		b = b || window.event;
		var a = {
			browserEvent : b,
			target : b.target || b.srcElement,
			type : b.type
		};
		return a;
	},
	normalizeMouseEvent : function(b) {
		b = b || window.event;
		var a = {
			browserEvent : b,
			target : b.target || b.srcElement,
			type : b.type,
			screenX : b.screenX,
			screenY : b.screenY,
			pageX : b.pageX || b.clientX,
			pageY : b.pageY || b.clientY,
			clientX : b.clientX,
			clientY : b.clientY,
			offsetX : b.offsetX || b.clientX,
			offsetY : b.offsetY || b.clientY,
			timeStamp : b.timeStamp || new Date().getTime()
		};
		return a;
	},
	domReady : {
		bInit : false,
		events : {},
		domReadyID : 1,
		bDone : false,
		add : function(b) {
			var a = tactile.c.V.domReady;
			if (!a.bInit) {
				a.init();
			}
			if (!b.$$domReadyID) {
				b.$$domReadyID = a.domReadyID++;
				if (a.bDone) {
					b();
				}
				a.events[b.$$domReadyID] = b;
			}
		},
		run : function() {
			var a = tactile.c.V.domReady;
			if (a.bDone) {
				return;
			}
			a.bDone = true;
			for ( var b in a.events) {
				a.events[b]();
			}
		},
		init : function() {
			if (document.addEventListener) {
				document.addEventListener("DOMContentLoaded", function() {
					document.removeEventListener("DOMContentLoaded",
							arguments.callee, false);
					tactile.c.V.domReady.run();
				}, false);
			} else {
				throw "browser do not support addEventListener";
			}
			tactile.c.V.domReady.bInit = true;
		}
	},
	resizeEvent : {
		events : {},
		eventID : 1,
		bInit : false,
		width : 0,
		height : 0,
		add : function(b) {
			var a = tactile.c.V.resizeEvent;
			if (!a.bInit) {
				a.init();
			}
			if (!b.$$eventID) {
				b.$$eventID = a.eventID++;
				a.events[b.$$eventID] = b;
			}
		},
		run : function() {
			var b = tactile.c.V.resizeEvent;
			var a = {
				screenWidth : b.width,
				screenHeight : b.height
			};
			for ( var c in b.events) {
				b.events[c](a);
			}
		},
		init : function() {
			var a = tactile.c.V.resizeEvent;
			var b = "resize";
			if (tactile.c.D.os.platform === "ios") {
				b = "orientationchange";
			} else {
				if ("onresize" in window) {
					b = "resize";
				} else {
					if ("onorientationchange" in window) {
						b = "orientationchange";
					}
				}
			}
			a.width = tactile.c.D.screen.getWidth();
			a.height = tactile.c.D.screen.getHeight();
			a.bInit = true;
			tactile.c.V.addListener(window, b, a.fire);
		},
		fire : function() {
			setTimeout("tactile.c.V.resizeEvent.fireImpl(" + 10 + ")", 100);
		},
		fireImpl : function(d) {
			var b = tactile.c.V.resizeEvent;
			var c, a;
			c = tactile.c.D.screen.getWidth();
			a = tactile.c.D.screen.getHeight();
			if (b.width !== c) {
				b.width = c;
				b.height = a;
				b.run();
			} else {
				if (d > 0) {
					setTimeout("tactile.c.V.resizeEvent.fireImpl(" + (d - 1)
							+ ")", 100);
				}
			}
		}
	}
};
var JSON;
if (!JSON) {
	JSON = {};
}
(function() {
	function f(n) {
		return n < 10 ? "0" + n : n;
	}
	if (typeof Date.prototype.toJSON !== "function") {
		Date.prototype.toJSON = function(key) {
			return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-"
					+ f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate())
					+ "T" + f(this.getUTCHours()) + ":"
					+ f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds())
					+ "Z" : null;
		};
	}
	if (typeof String.prototype.toJSON !== "function") {
		String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(
				key) {
			return this.valueOf();
		};
	}
	var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
		"\b" : "\\b",
		"\t" : "\\t",
		"\n" : "\\n",
		"\f" : "\\f",
		"\r" : "\\r",
		'"' : '\\"',
		"\\" : "\\\\"
	}, rep;
	function quote(string) {
		escapable.lastIndex = 0;
		return escapable.test(string) ? '"'
				+ string.replace(escapable,
						function(a) {
							var c = meta[a];
							return typeof c === "string" ? c : "\\u"
									+ ("0000" + a.charCodeAt(0).toString(16))
											.slice(-4);
						}) + '"' : '"' + string + '"';
	}
	function str(key, holder) {
		var i, k, v, length, mind = gap, partial, value = holder[key];
		if (value && typeof value === "object"
				&& typeof value.toJSON === "function") {
			value = value.toJSON(key);
		}
		if (typeof rep === "function") {
			value = rep.call(holder, key, value);
		}
		switch (typeof value) {
		case "string":
			return quote(value);
		case "number":
			return isFinite(value) ? String(value) : "null";
		case "boolean":
		case "null":
			return String(value);
		case "object":
			if (!value) {
				return "null";
			}
			gap += indent;
			partial = [];
			if (Object.prototype.toString.apply(value) === "[object Array]") {
				length = value.length;
				for (i = 0; i < length; i += 1) {
					partial[i] = str(i, value) || "null";
				}
				v = partial.length === 0 ? "[]" : gap ? "[\n" + gap
						+ partial.join(",\n" + gap) + "\n" + mind + "]" : "["
						+ partial.join(",") + "]";
				gap = mind;
				return v;
			}
			if (rep && typeof rep === "object") {
				length = rep.length;
				for (i = 0; i < length; i += 1) {
					if (typeof rep[i] === "string") {
						k = rep[i];
						v = str(k, value);
						if (v) {
							partial.push(quote(k) + (gap ? ": " : ":") + v);
						}
					}
				}
			} else {
				for (k in value) {
					if (Object.prototype.hasOwnProperty.call(value, k)) {
						v = str(k, value);
						if (v) {
							partial.push(quote(k) + (gap ? ": " : ":") + v);
						}
					}
				}
			}
			v = partial.length === 0 ? "{}" : gap ? "{\n" + gap
					+ partial.join(",\n" + gap) + "\n" + mind + "}" : "{"
					+ partial.join(",") + "}";
			gap = mind;
			return v;
		}
	}
	if (typeof JSON.stringify !== "function") {
		JSON.stringify = function(value, replacer, space) {
			var i;
			gap = "";
			indent = "";
			if (typeof space === "number") {
				for (i = 0; i < space; i += 1) {
					indent += " ";
				}
			} else {
				if (typeof space === "string") {
					indent = space;
				}
			}
			rep = replacer;
			if (replacer
					&& typeof replacer !== "function"
					&& (typeof replacer !== "object" || typeof replacer.length !== "number")) {
				throw new Error("JSON.stringify");
			}
			return str("", {
				"" : value
			});
		};
	}
	if (typeof JSON.parse !== "function") {
		JSON.parse = function(text, reviver) {
			var j;
			function walk(holder, key) {
				var k, v, value = holder[key];
				if (value && typeof value === "object") {
					for (k in value) {
						if (Object.prototype.hasOwnProperty.call(value, k)) {
							v = walk(value, k);
							if (v !== undefined) {
								value[k] = v;
							} else {
								delete value[k];
							}
						}
					}
				}
				return reviver.call(holder, key, value);
			}
			text = String(text);
			cx.lastIndex = 0;
			if (cx.test(text)) {
				text = text.replace(cx,
						function(a) {
							return "\\u"
									+ ("0000" + a.charCodeAt(0).toString(16))
											.slice(-4);
						});
			}
			if (/^[\],:{}\s]*$/
					.test(text
							.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
							.replace(
									/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
									"]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
				j = eval("(" + text + ")");
				return typeof reviver === "function" ? walk({
					"" : j
				}, "") : j;
			}
			throw new SyntaxError("JSON.parse");
		};
	}
}());
if (tactile.effects == null || typeof (tactile.effects) != "object") {
	tactile.effects = {};
}
if (tactile.events == null || typeof (tactile.events) != "object") {
	tactile.events = {};
}
if (tactile.foundation == null || typeof (tactile.foundation) != "object") {
	tactile.foundation = {};
}
tactile.logger = (function() {
	var c = function(d) {
		this.init(d);
	};
	c.prototype = {
		startY : 0,
		subcontainer : null,
		init : function(d) {
			this.container = d;
			this.subcontainer = d.querySelector(".contentHolder");
			if ("ontouchstart" in window) {
				this.isTought = true;
				this.container.addEventListener("touchstart",
						this.onScrollStart.bind(this), false);
				document.addEventListener("touchend", this.onScrollEnd
						.bind(this), false);
			} else {
				this.isTought = false;
				this.container.addEventListener("mousedown", this.onScrollStart
						.bind(this), false);
				document.addEventListener("mouseup", this.onScrollEnd
						.bind(this), false);
			}
		},
		onScrollMove : function() {
		},
		onScrollStart : function(g) {
			var f, d = this;
			if (this.isTought) {
				f = g.touches[0].pageY;
			} else {
				f = g.pageY;
			}
			this.startY = f;
			this.onScrollMove = function(i) {
				i.preventDefault();
				i.stopPropagation();
				var h;
				if (d.isTought) {
					h = i.touches[0].pageY;
				} else {
					h = i.pageY;
				}
				if (d.startY != h) {
					var k = d.startY - h;
					d.subcontainer.style.top = (d.subcontainer.offsetTop - k)
							+ "px";
					if (d.subcontainer.offsetTop > 0) {
						d.subcontainer.style.top = "0px";
					} else {
						if ((d.subcontainer.offsetHeight + d.subcontainer.offsetTop) < (d.container.offsetHeight + 10)) {
							d.subcontainer.style.top = (d.container.offsetHeight - d.subcontainer.offsetHeight)
									+ "px";
						}
					}
					d.startY = h;
				}
			};
			if (this.container.offsetHeight < this.subcontainer.offsetHeight) {
				if (this.isTought) {
					this.container.addEventListener("touchmove",
							this.onScrollMove, false);
				} else {
					this.container.addEventListener("mousemove",
							this.onScrollMove, false);
				}
			}
		},
		onScrollEnd : function() {
			if (this.isTought) {
				this.container.removeEventListener("touchmove",
						this.onScrollMove, false);
			} else {
				this.container.removeEventListener("mousemove",
						this.onScrollMove, false);
			}
		}
	};
	var a = {
		request : function() {
			var d = false;
			if (window.XMLHttpRequest) {
				d = new XMLHttpRequest();
			} else {
				if (window.ActiveXObject) {
					d = new ActiveXObject("Microsoft.XMLHTTP");
					if (!d) {
						HRequest = new ActiveXObject("Msxml2.XMLHTTP");
					}
				}
			}
			if (!d) {
				throw ("XMLHttpRequest error!!");
			}
			return d;
		},
		sendRequest : function(g, f, h, d) {
			var e = this.request();
			if (!e) {
				return;
			}
			e.onreadystatechange = function() {
				if (e.readyState == 4) {
					d(e);
				}
			};
			if (g.toLowerCase() == "get" && h.length > 0) {
				f += "?" + h;
			}
			e.open(g, f, true);
			if (g.toLowerCase() == "post") {
				e.setRequestHeader("Content-Type",
						"application/x-www-form-urlencoded; charset=utf-8");
				e.send(h);
			} else {
				e.send(null);
			}
		}
	};
	var b = function() {
	};
	b.prototype.setConfig = function(d) {
		this.message.isAjax = d.isAjax || false;
		this.message.isOverlay = d.isOverlay || false;
		this.level = d.level || 0;
		this.message.height = d.height || 300;
		this.setLevel(this.level);
		this.filter = d.filter || [ "all" ];
		if (this.message.isAjax) {
			this.message.ajaxUrl = d.ajaxUrl || "";
		}
		if (this.message.isOverlay) {
			try {
				this.message.createOverlay();
			} catch (f) {
				document.addEventListener("DOMContentLoaded",
						this.message.createOverlay.bind(this.message), false);
			}
		}
		if (this.message.isOverlay || this.message.isAjax) {
			this.interval((d.timeout || 400));
		}
	};
	b.prototype.interval = function(d) {
		setInterval((function() {
			if (this.message.isAjax) {
				this.message.sendAjax();
			}
			if (this.message.isOverlay) {
				this.message.printToOverlay();
			}
		}).bind(this), d);
	};
	b.prototype.message = {
		ajaxUrl : "",
		updateTime : 0,
		lastUpdateTime : 0,
		scroller : null,
		tplObj : {
			items : [ {
				element : "ul",
				items : [ {
					element : "li",
					key : "level"
				}, {
					element : "li",
					key : "message"
				}, {
					element : "li",
					key : "date"
				} ]
			} ]
		},
		getContainerHeight : function() {
			if (this.height != "fit" && typeof this.height == "string") {
				return 300;
			} else {
				if (this.height == "fit") {
					if (window.innerWidth) {
						return window.innerHeight - 20;
					} else {
						if (document.documentElement
								&& (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
							return document.documentElement.clientHeight - 20;
						}
					}
				} else {
					return this.height;
				}
			}
		},
		cssProperties : [
				"div.log-container {margin:10px; border:3px solid #ccc; background-color:#fff;}",
				"h3 {padding:10px; margin:0; font:14px Arial; color: #fff;font-weight:bolder; text-transform:uppercase;}",
				"ul{margin:0; padding:10px;}",
				"div.log-container ul:nth-child(odd){background-color:#fbfafa;}",
				"div.log-container ul:hover{background-color:#d4f4ff !important;}",
				"li{list-style:none;}",
				"li.level{font:14px Arial; color: #fff; text-transform:uppercase; width: 60px; padding:5px 5px 5px 10px; margin-left:-20px; margin-bottom:10px;}",
				"li.level.info {background-color:#29cb7a;}",
				"li.level.warn {background-color:#ff865d;}",
				"li.level.error {background-color:#ff95c0;}",
				"li.message{font:14px Arial; color: #333; text-transform:uppercase;}",
				"li.date{padding-top: 10px; font:11px Arial; color: #777; text-transform:uppercase;}" ],
		overlayProperty : [
				".overlay{position: fixed; z-index: 99999;bottom: 10px;left:10px;right: 10px;background-color: rgba(0,0,0,0.7); height: 24px;}",
				".overlay *{-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-o-user-select: none;user-select: none;}",
				"div.overlay>div.header{font-family: Arial;text-transform: UPPERCASE;font-weight: bolder;font-size: 14px;line-height: 24px;height: 24px;background-color: rgba(0,0,0,0.4);color:#fff;padding-left: 10px;}",
				"div.overlay>div.wrapper{position: absolute; overflow:hidden; top:34px; left:10px;right: 10px;bottom: 10px;}",
				"div.overlay>div.wrapper>div.contentHolder{position: absolute; top:0px; left:0; width:100%}" ],
		template : function(l, f) {
			var k = [], h, e, g;
			for (g = 0; g < l.length; g++) {
				h = document.createElement(l[g].element);
				if (l[g].items && l[g].items.length > 0) {
					e = arguments.callee(l[g].items, f);
					for ( var d = 0; d < e.length; d++) {
						h.appendChild(e[d]);
					}
				} else {
					if (l[g].key) {
						if (f[l[g].key]) {
							h.appendChild(document.createTextNode(f[l[g].key]));
						}
						h.setAttribute("class", (l[g].key == "level" ? l[g].key
								+ " " + f[l[g].key] : l[g].key));
					}
				}
				k.push(h);
			}
			return k;
		},
		createHtml : function() {
			var d = document.createElement("div");
			d.setAttribute("class", "log-container");
			var h = document.createElement("style");
			h.type = "text/css";
			d.appendChild(h);
			for ( var k = 0; k < this.cssProperties.length; k++) {
				h.appendChild(document.createTextNode(this.cssProperties[k]));
			}
			for ( var f = 0; f < this.logCollection.length; f++) {
				var g = this.template(this.tplObj.items, this.logCollection[f]);
				for ( var e = 0; e < g.length; e++) {
					d.appendChild(g[e]);
				}
			}
			return d;
		},
		createOverlay : function() {
			var f = document.createElement("style"), e = document
					.createElement("div"), i = document.createElement("div"), h = document
					.createElement("div"), d = document.createElement("div");
			f.type = "text/css";
			document.querySelector("body").appendChild(f);
			for ( var g = 0; g < this.overlayProperty.length; g++) {
				f.appendChild(document.createTextNode(this.overlayProperty[g]));
			}
			e.setAttribute("class", "overlay");
			i.setAttribute("class", "header");
			i.appendChild(document.createTextNode("Logger"));
			e.appendChild(i);
			h.setAttribute("class", "wrapper");
			e.appendChild(h);
			d.setAttribute("class", "contentHolder");
			h.appendChild(d);
			i.addEventListener("click", function() {
				var k = e.className.split(" ");
				if (k.length > 1) {
					e.className = "overlay";
					e.style.height = "24px";
				} else {
					e.className = "overlay open";
					e.style.height = this.getContainerHeight() + "px";
					if (!this.scroller) {
						this.scroller = new c(e.querySelector(".wrapper"));
					}
				}
			}.bind(this), false);
			document.querySelector("body").appendChild(e);
		},
		logCollection : [],
		clearResults : function() {
			if (this.ajaxPrinted && this.overlayPrinted) {
				this.lastUpdateTime = this.updateTime;
				this.logCollection = [];
			}
		},
		ajaxPrinted : true,
		overlayPrinted : true,
		sendAjax : function() {
			if (this.ajaxUrl == "") {
				return false;
			}
			if (this.lastUpdateTime != this.updateTime) {
				var d = this.createHtml();
				a.sendRequest("post", this.ajaxUrl, (new XMLSerializer()
						.serializeToString(d)), (function() {
					this.ajaxPrinted = true;
					this.clearResults();
				}).bind(this));
			}
		},
		printToOverlay : function() {
			if (this.lastUpdateTime != this.updateTime) {
				var d = this.createHtml();
				if (document.querySelector(".overlay .wrapper .contentHolder").childNodes.length == 0) {
					document.querySelector(".overlay .wrapper .contentHolder")
							.appendChild(d);
				} else {
					document
							.querySelector(".overlay .wrapper .contentHolder")
							.insertBefore(
									d,
									document
											.querySelector(".overlay .wrapper .contentHolder").childNodes[0]);
				}
				this.overlayPrinted = true;
				this.clearResults();
			}
		},
		createReport : function(f, e) {
			var d = {
				level : f,
				message : e || "",
				date : (new Date()).toGMTString()
			};
			this.logCollection.splice(0, 0, d);
			this.updateTime = (new Date()).getTime();
			this.ajaxPrinted = !this.isAjax;
			this.overlayPrinted = !this.isOverlay;
		}
	};
	b.prototype.filter = [ "all" ];
	b.prototype.checkFilters = function(e, d) {
		if (!d || typeof d != "string") {
			d = "all";
		}
		if (this.filter.contains(d) || this.filter.contains("all")) {
			return true;
		}
		return false;
	};
	b.prototype.error = function(e, d) {
		if (!this.checkFilters.apply(this, arguments)) {
			return false;
		}
		if (this.level >= 1) {
			this.message.createReport.call(this.message, "error", e);
			this.log("error", e);
		}
	};
	b.prototype.warn = function(e, d) {
		if (!this.checkFilters.apply(this, arguments)) {
			return false;
		}
		if (this.level >= 2) {
			this.message.createReport.call(this.message, "warn", e);
			this.log("warn", e);
		}
	};
	b.prototype.info = function(e, d) {
		if (!this.checkFilters.apply(this, arguments)) {
			return false;
		}
		if (this.level >= 3) {
			this.message.createReport.call(this.message, "info", e);
			this.log("info", e);
		}
	};
	b.prototype.log = function(e, d) {
		if (typeof console === "object" && console.log !== undefined) {
			console.log(e + " - " + d);
		}
	};
	b.prototype.setLevel = function(d) {
		this.level = d;
	};
	return new b();
})();
tactile.logger.level = {
	info : 3,
	warn : 2,
	error : 1,
	disabled : 0
};
tactile.events.TouchEventManager = {
	firstTap : 0,
	bInit : false,
	touchnames : "tap|doubletap|swipe|scroll|scrollstart|scrollend|touchstart|touchmove|touchend",
	swipeOffsetMin : 35,
	scrollOffsetMin : 5,
	tapOffsetMin : 5,
	touchEndOffsetMin : 35,
	swipeTimeMin : 500,
	doubleTapLimit : 800,
	listeners : {},
	traces : {},
	doubleTapTargets : {},
	touchEvents : {
		all : [],
		touchstart : [],
		touchmove : [],
		touchend : [],
		tap : [],
		doubletap : [],
		swipe : [],
		scrollstart : [],
		scroll : [],
		scrollend : []
	},
	isTouchEvent : function(b) {
		var a = tactile.events.TouchEventManager;
		if (a.touchnames.indexOf(b) !== -1) {
			return true;
		} else {
			return false;
		}
	},
	init : function() {
		var a = tactile.events.TouchEventManager;
		if (tactile.Device.isTouch) {
			tactile.c.V.addListener(document, "touchstart", a.onTouchStart);
			tactile.c.V.addListener(document, "touchmove", a.onTouchMove);
			tactile.c.V.addListener(document, "touchend", a.onTouchEnd);
			if (tactile.Device.platform === "ios") {
				tactile.c.V.addListener(document, "gesturestart",
						a.cancelGesture);
				tactile.c.V.addListener(document, "gesturechange",
						a.cancelGesture);
				tactile.c.V
						.addListener(document, "gestureend", a.cancelGesture);
			}
		} else {
			tactile.c.V.addListener(document, "mousedown", a.onTouchStart);
			tactile.c.V.addListener(document, "mousemove", a.onTouchMove);
			tactile.c.V.addListener(document, "mouseup", a.onTouchEnd);
		}
		a.bInit = true;
	},
	onTouchStart : function(f) {
		if (tactile.Device.platform === "ios") {
			tactile.events.TouchEventManager.secondTap = f.timeStamp;
			var g = tactile.events.TouchEventManager.secondTap
					- tactile.events.TouchEventManager.firstTap;
			var c = false;
			if (tactile.events.TouchEventManager.firstTap > 0) {
				if (g < 500) {
					c = true;
				}
			}
			tactile.events.TouchEventManager.firstTap = tactile.events.TouchEventManager.secondTap;
			if (c) {
				f.preventDefault();
			}
		}
		var a = tactile.events.TouchEventManager, d = tactile.Device.isTouch ? f.touches
				: [ f ];
		a.touchEventRegistered = false;
		for ( var b = 0; b < d.length; b++) {
			a.watching(d[b], f);
		}
		a.isMultiTouch = d.length > 1;
	},
	cancelGesture : function(a) {
		a.preventDefault();
	},
	watching : function(d, f) {
		var m = tactile.events.TouchEventManager, g = (d.target.nodeType == 3) ? d.target.parentNode
				: d.target, k = g, l = d.identifier != undefined ? d.identifier
				: "mouse", h, i, a, c, b;
		if (m.traces[l]) {
			f.preventDefault();
			f.stopPropagation();
			return;
		}
		c = m.traces[l] = {
			browserEvent : f,
			startTime : f.timeStamp,
			previousTime : f.timeStamp,
			startX : d.pageX,
			startY : d.pageY,
			previousX : d.pageX,
			previousY : d.pageY,
			touch : d,
			target : g,
			scrolling : false,
			end : false,
			move : false,
			targets : {},
			scrollBounds : {
				right : window.innerWidth + document.body.scrollLeft,
				bottom : window.innerHeight + document.body.scrollTop
			}
		};
		while (k) {
			if (m.touchEvents.all.indexOf(k) !== -1) {
				a = k.id;
				h = m.listeners[a];
				c.events = c.events || {};
				for (i in h) {
					if (h.hasOwnProperty(i)) {
						c.events[i] = c.events[i] || {};
						c.events[i][a] = h[i];
						c.events[i][a].dom = k;
						c.targets[a] = h[i];
					}
				}
			}
			k = k.parentNode;
		}
		m.lastTouchId = l;
		if (c.events) {
			b = {
				timeStamp : f.timeStamp,
				pageX : d.pageX,
				pageY : d.pageY,
				touch : d,
				touches : f.touches ? f.touches : [ f.touch ],
				browserEvent : f
			};
			if (c.events.touchstart
					&& m.fireListeners("touchstart", c, b) === false) {
				c.end = true;
				return;
			}
			if (c.events.tap || c.events.doubletap) {
				c.tap = true;
			}
			c.move = c.end = true;
		}
	},
	onTouchMove : function(B) {
		var u = tactile.events.TouchEventManager, r = tactile.Device.isTouch ? B.changedTouches
				: [ B ], q = r.length, x, p, y, w, v;
		for (x = 0; x < q; x++) {
			p = r[x];
			y = u.traces[p.identifier != undefined ? p.identifier : "mouse"];
			if (!y || !y.move) {
				continue;
			}
			var A = y.startX, z = y.startY, d = p.pageX, b = p.pageY, h = y.previousX, f = y.previousY, D = d
					- A, C = b - z, c = Math.abs(D), a = Math.abs(C), k = d - h, g = b
					- f, o = B.timeStamp;
			var t = y.startTime, n = y.previousTime, l = o - t, s = o - n, m = B;
			if (y.tap && ((c >= u.tapOffsetMin) || (a >= u.tapOffsetMin))) {
				if (y.events.doubletap) {
					delete y.events.doubletap;
				}
				delete y.events.tap;
				y.tap = false;
			}
			v = {
				pageX : d,
				pageY : b,
				startX : A,
				startY : z,
				deltaX : D,
				deltaY : C,
				timeStamp : o,
				startTime : t,
				deltaTime : l,
				browserEvent : m
			};
			if (y.events.touchmove
					&& u.fireListeners("touchmove", y, v) === false) {
				y.previousTime = o;
				y.previousX = d;
				y.previousY = b;
				y.previousDeltaX = k;
				y.previousDeltaY = g;
				continue;
			}
			if (!y.scrolling && y.events.swipe) {
				if (a - c > 2 || l > u.swipeTimeMin) {
					delete y.events.swipe;
				} else {
					if (c > u.swipeOffsetMin && c > a) {
						delete y.events.scroll;
						delete y.events.scrollstart;
						delete y.events.scrollend;
						u.fireListeners("swipe", y, {
							browserEvent : m,
							direction : (D < 0) ? "left" : "right",
							distance : c,
							timeStamp : o,
							deltaTime : l
						});
						delete y.events.swipe;
					}
				}
				continue;
			}
			if (y.events.scroll || y.events.scrollstart || y.events.scrollend) {
				if (!y.scrolling
						&& (c >= u.scrollOffsetMin || a >= u.scrollOffsetMin)) {
					y.scrolling = true;
					delete y.events.swipe;
					if (y.events.scrollstart) {
						u.fireListeners("scrollstart", y, {
							browserEvent : y.browserEvent,
							timeStamp : o,
							pageX : d,
							pageY : b
						});
					}
				} else {
					if (y.scrolling) {
						u.fireListeners("scroll", y, v);
					}
				}
			}
			if (!y.tap) {
				if (c > a) {
					if (D > 0) {
						if (y.scrollBounds.right - d < u.touchEndOffsetMin) {
							u.onTouchEnd(m);
							return;
						}
					} else {
						if (d < u.touchEndOffsetMin) {
							u.onTouchEnd(m);
							return;
						}
					}
				} else {
					if (C > 0) {
						if (y.scrollBounds.bottom - b < u.touchEndOffsetMin) {
							u.onTouchEnd(m);
							return;
						}
					} else {
						if (b < u.touchEndOffsetMin) {
							u.onTouchEnd(m);
							return;
						}
					}
				}
			}
			y.previousTime = o;
			y.previousX = d;
			y.previousY = b;
			y.previousDeltaX = k;
			y.previousDeltaY = g;
		}
	},
	onTouchEnd : function(h) {
		var o = tactile.events.TouchEventManager, m = o.traces, g = tactile.Device.isTouch ? h.changedTouches
				: [ h ], k = g.length, c, d, f, b;
		for (f = 0; f < k; f++) {
			c = g[f];
			d = m[c.identifier != undefined ? c.identifier : "mouse"];
			if (!d || !d.end) {
				continue;
			}
			b = {
				browserEvent : h,
				pageX : d.previousX,
				pageY : d.previousY,
				deltaX : d.previousX - d.startX,
				deltaY : d.previousY - d.startY,
				startX : d.startX,
				startY : d.startY,
				deltaTime : h.timeStamp - d.startTime,
				startTime : d.startTime,
				timeStamp : h.timeStamp
			};
			if (d.events.touchend
					&& o.fireListeners("touchend", d, b) === false) {
				break;
			}
			if (d.scrolling && d.events.scrollend) {
				o.fireListeners("scrollend", d, b);
			} else {
				if (d.events.tap) {
					var a = {
						browserEvent : h,
						timeStamp : h.timeStamp,
						pageX : d.startX,
						pageY : d.startY,
						touch : d.touch
					};
					o.fireListeners("tap", d, a);
				}
			}
			if (d.events.doubletap && !o.isMultiTouch) {
				var n = d.target.id;
				if (!o.doubleTapTargets[n]) {
					o.doubleTapTargets[n] = h.timeStamp;
				} else {
					var l = h.timeStamp;
					if (l - o.doubleTapTargets[n] <= o.doubleTapLimit) {
						var a = {
							browserEvent : h,
							timeStamp : h.timeStamp,
							pageX : d.startX,
							pageY : d.startY,
							touch : d.touch
						};
						o.fireListeners("doubletap", d, a);
						delete o.doubleTapTargets[n];
					} else {
						o.doubleTapTargets[n] = h.timeStamp;
					}
				}
			}
			delete m[c.identifier];
		}
		o.traces = {};
	},
	addListener : function(c, d, b) {
		var a = tactile.events.TouchEventManager;
		if (!a.bInit) {
			a.init();
		}
		if (!a.touchEvents[d]) {
			return;
		}
		if (!a.touchEvents.all.contains(c)) {
			a.touchEvents.all.push(c);
		}
		if (!a.touchEvents[d].contains(c)) {
			a.touchEvents[d].push(c);
		}
		var f = c.id, e;
		b.eventtype = d;
		a.listeners[f] = a.listeners[f] || {};
		a.listeners[f][d] = a.listeners[f][d] || [];
		a.listeners[f][d].push(b);
		for (f in a.traces) {
			e = a.traces[f];
			if (e && (c == document || c === e.target || c.contains(e.target))) {
				e.events[d] = e.events[d] || {};
				e.events[d][f] = e.events[d][f] || [];
				e.events[d][f].push(b);
				if (/touchmove|scroll|swipe|tap/i.test(d)) {
					e.move = true;
				}
				if (/touchend|scrollend|tap|/i.test(d)) {
					e.end = true;
				}
			}
		}
	},
	removeListener : function(e, f, d) {
		var b = tactile.events.TouchEventManager;
		if (!b.touchEvents[f]) {
			return;
		}
		b.touchEvents[f].remove(e);
		var g = e.id, c = b.listeners[g], f, a = false;
		if (c && c[f]) {
			c[f].remove(d);
			if (!c[f].length) {
				delete c[f];
			}
			for (f in c) {
				if (c.hasOwnProperty(f)) {
					a = true;
					break;
				}
			}
			if (!a) {
				b.touchEvents.all.remove(e);
				delete c[g];
			}
		}
	},
	fireListeners : function(m, d, g) {
		g.type = m;
		g.target = d.target;
		g.touch = d.touch;
		g.identifier = d.touch.identifier;
		var f = d.events[m], h, l, b, a, c, k;
		if (f) {
			for (a in f) {
				if (f.hasOwnProperty(a)) {
					l = f[a];
					for (c = 0, k = l.length; c < k; c++) {
						b = l[c];
						if (b.call(l.dom, g) === false || g.cancel === true) {
							if (g.browserEvent) {
								g.browserEvent.stopPropagation();
								g.browserEvent.preventDefault();
							}
							return false;
						}
					}
				}
			}
		}
		return true;
	}
};
tactile.Enum = {
	Direction : {
		north : "north",
		east : "east",
		south : "south",
		west : "west"
	},
	Display : {
		block : "block",
		inline : "inline",
		none : "none",
		inherit : "inherit"
	},
	Effects : {
		slide : "slide",
		fade : "fade",
		expand : "expand"
	},
	FlexFlow : {
		horizontal : "horizontal",
		vertical : "vertical"
	},
	Dimension : {
		width : "width",
		height : "height"
	},
	Float : {
		left : "left",
		right : "right",
		none : "none",
		inherit : "inherit"
	},
	Overflow : {
		visible : "visible",
		hidden : "hidden",
		inherit : "inherit"
	},
	Position : {
		"static" : "static",
		absolute : "absolute",
		relative : "relative",
		inherit : "inherit"
	},
	Scroll : {
		horizontal : "horizontal",
		vertical : "vertical",
		both : "both",
		disabled : "disabled"
	},
	Transitions : {
		linear : "linear",
		easeIn : "ease-in",
		easeOut : "ease-out",
		easeInOut : "ease-in-out",
		easeOutIn : "ease-out-in"
	},
	Unit : {
		percent : "%",
		px : "px",
		em : "em"
	},
	Events : {
		touchstart : "touchstart",
		touchmove : "touchmove",
		touchend : "touchend",
		scrollstart : "scrollstart",
		scroll : "scroll",
		scrollend : "scrollend",
		tap : "tap",
		doubletap : "doubletap",
		swipe : "swipe"
	},
	contains : function(e, d) {
		if (d === undefined || d === null) {
			return false;
		}
		var c = false;
		var b = d.toLowerCase();
		for ( var a in e) {
			if (e[a] == b) {
				c = true;
				break;
			}
		}
		return c;
	},
	getValue : function(d, c) {
		if (c === undefined) {
			return "";
		}
		var b = c.toLowerCase();
		for ( var a in d) {
			if (d[a] == b) {
				return d[a];
				break;
			}
		}
		return "";
	}
};
tactile.effects.Operations = {
	show : "show",
	hide : "hide",
	move : "move",
	none : "none"
};
tactile.effects.Properties = {
	left : "left",
	top : "top",
	width : "width",
	height : "height"
};
tactile.effects.Method = {
	javascript : "javascript",
	transition : "transition",
	transform : "transform",
	transform3d : "transform3d"
};
tactile.effects.Direction = {
	horizontal : "horizontal",
	vertical : "vertical"
};
tactile.effects.Transitions = {
	linear : function(a) {
		return a;
	},
	inQuad : function(a) {
		return Math.pow(a, 2);
	},
	inCubic : function(a) {
		return Math.pow(a, 3);
	},
	outQuad : function(a) {
		return 1 - Math.pow((a - 1), 2);
	},
	outCubic : function(a) {
		return 1 + Math.pow((a - 1), 3);
	},
	inOutQuad : function(a) {
		return 2 * Math.pow(a, 3) + 3 * Math.pow(a, 2);
	},
	inCirc : function(a) {
		return 1 - Math.sqrt(1 - Math.pow(a, 2));
	},
	outCirc : function(a) {
		return Math.sqrt(a);
	},
	inElastic : function(a) {
		return Math.pow(a, 4) * Math.sin(a * Math.PI * 6.5);
	},
	outElastic : function(a) {
		return 1 - Math.pow(a - 1, 4) * Math.sin((1 - a) * Math.PI * 6.5);
	},
	sinoidal : function(a) {
		return (-Math.cos(a * Math.PI) / 2) + 0.5;
	},
	cosinus : function(a) {
		return Math.cos(a);
	},
	decel : function(a) {
		return -Math.pow(a, 2) + 2 * a;
	},
	easeIn : this.inQuad,
	easeOut : this.outQuad,
	easeInOut : this.inOutQuad,
	easeOutIn : this.outElastic
};
tactile.effects.Timing = {
	linear : "linear",
	easeIn : "ease-in",
	easeOut : "ease-out",
	easeInOut : "ease-in-out",
	easeOutIn : "ease-out-in"
};
tactile.effects.Base = function() {
	this.init = function(a, b) {
		if (!a instanceof tactile.foundation.UIContainer) {
			throw "Error - type mismatch: tactile.effects.Slide expects constructor argument of type UIComponent!";
		}
		this.inst = a;
		b = b || {};
		this.duration = b.duration || tactile.Device.defaults.effectduration;
		this.useTransition = tactile.Device.browser.csstransitions;
		this.useTransform = tactile.Device.browser.csstransforms;
		this.useTransform3d = tactile.Device.browser.csstransforms3d;
		this.fps = 20;
		if (typeof nbdevice == "object") {
			if (this instanceof tactile.effects.Slide) {
				if (nbdevice.tactileslidemethod) {
					var c = nbdevice.tactileslidemethod.toLowerCase();
					this.useTransform3d = (c == tactile.effects.Method.transform3d);
					this.useTransform = (c == tactile.effects.Method.transform);
					this.useTransition = (c == tactile.effects.Method.transition);
					if (c == tactile.effects.Method.javascript
							&& nbdevice.tactileslidefps) {
						this.fps = Number(nbdevice.tactileslidefps);
					}
				}
			} else {
				if (this instanceof tactile.effects.Fade) {
					if (nbdevice.tactilefademethod) {
						var c = nbdevice.tactilefademethod.toLowerCase();
						this.useTransform3d = (c == tactile.effects.Method.transform3d);
						this.useTransform = (c == tactile.effects.Method.transform);
						this.useTransition = (c == tactile.effects.Method.transition);
						if (c == tactile.effects.Method.javascript
								&& nbdevice.tactilefadefps) {
							this.fps = Number(nbdevice.tactilefadefps);
						}
					}
				} else {
					if (this instanceof tactile.effects.Expand) {
						if (nbdevice.tactileexpandmethod) {
							var c = nbdevice.tactileexpandmethod.toLowerCase();
							this.useTransform3d = (c == tactile.effects.Method.transform3d);
							this.useTransform = (c == tactile.effects.Method.transform);
							this.useTransition = (c == tactile.effects.Method.transition);
							if (c == tactile.effects.Method.javascript
									&& nbdevice.tactileexpandfps) {
								this.fps = Number(nbdevice.tactileexpandfps);
							}
						}
					}
				}
			}
		}
		if (b.fps) {
			this.fps = b.fps;
		}
		if (b.method && b.method == tactile.effects.Method.javascript) {
			this.useTransition = false;
			this.useTransform = false;
			this.useTransform3d = false;
		}
		if (b.method && b.method == tactile.effects.Method.transition) {
			this.useTransform = false;
			this.useTransition = true;
			this.useTransform3d = false;
		}
		if (b.method && b.method == tactile.effects.Method.transform) {
			this.useTransition = false;
			this.useTransform = true;
			this.useTransform3d = false;
		}
		if (b.method && b.method == tactile.effects.Method.transform3d) {
			this.useTransition = false;
			this.useTransform = false;
			this.useTransform3d = true;
		}
		if (this instanceof tactile.effects.Fade
				|| this instanceof tactile.effects.Expand) {
			this.useTransform3d = false;
		}
		if (this.useTransition || this.useTransform || this.useTransform3d) {
			this.timing = tactile.effects.Timing.easeOut;
			if (b.transition
					&& tactile.Enum.contains(tactile.Enum.Transitions,
							b.transition)) {
				this.timing = tactile.Enum.getValue(tactile.Enum.Transitions,
						b.transition);
			}
		} else {
			this.timing = tactile.effects.Transitions.outCubic;
			if (b.transition
					&& tactile.Enum.contains(tactile.Enum.Transitions,
							b.transition)) {
				this.timing = tactile.effects.Transitions[tactile.Enum
						.getValue(tactile.Enum.Transitions, b.transition)];
			}
		}
		if (this.useTransform || this.useTransform3d) {
			if (this.inst instanceof tactile.FlexView) {
				this.inst.flexitems.forEach(function(d) {
					tactile.c.U.applyTransformFlickerFix(d.elem);
				});
			}
			if (this.inst.parent instanceof tactile.MultiView) {
				this.inst.parent.views.forEach(function(d) {
					tactile.c.U.applyTransformFlickerFix(d.elem);
				});
			}
		}
	};
	this.timer = null;
	this.from = null;
	this.to = null;
	this.prop = null;
	this.start = null;
	this.endEventAdded = false;
	this.op = tactile.effects.Operations.none;
};
tactile.effects.Base.prototype.getMethod = function() {
	if (this.useTransform3d) {
		return tactile.effects.Method.transform3d;
	} else {
		if (this.useTransform) {
			return tactile.effects.Method.transform;
		} else {
			if (this.useTransition) {
				return tactile.effects.Method.transition;
			} else {
				return tactile.effects.Method.javascript;
			}
		}
	}
};
tactile.effects.Base.prototype.step = function() {
	var c = (new Date).getTime();
	if (c < this.start + this.duration) {
		var a = (c - this.start) / this.duration;
		var b = Math.round(this.from + (this.to - this.from) * this.timing(a));
		this.jsstep(b);
	} else {
		clearInterval(this.timer);
		this.timer = null;
		if (this.op == tactile.effects.Operations.hide) {
			this.inst.elem.style.display = tactile.Enum.Display.none;
			if (this.inst.afterhide) {
				this.inst.afterhide.fire({
					targetId : this.inst.id
				});
			}
		} else {
			if (this.op == tactile.effects.Operations.show) {
				if (this.inst.aftershow) {
					this.inst.aftershow.fire({
						targetId : this.inst.id
					});
				}
			}
		}
		if (this.onend) {
			this.onend.fire({
				operation : this.op
			});
		}
		this.op = tactile.effects.Operations.none;
	}
};
tactile.effects.Base.prototype.setEndEvent = function() {
	if (this.endEventAdded) {
		return;
	}
	if (tactile.Device.browser.transitionEndEventSupported()) {
		if (!this.endEventAdded) {
			tactile.c.V.addManagedListener(this.inst.elem,
					tactile.Device.browser.transitionEndEventType(),
					this.transitionEnd, this);
			this.endEventAdded = true;
		}
	} else {
		setTimeout(this.transitionEnd.bind(this), this.duration + 200);
	}
};
tactile.effects.Base.prototype.transitionEnd = function(a) {
};
tactile.effects.Slide = function(a, b) {
	tactile.effects.Slide.prototype.init.call(this, a, b);
	this.jsstep = function(c) {
		this.inst.elem.style[this.prop] = c + tactile.Enum.Unit.px;
	};
	this.onend = new tactile.foundation.Observer();
	this.leftOffset = (typeof this.inst.configLeft === "function") ? this.inst
			.configLeft() : 0;
	this.topOffset = (typeof this.inst.configTop === "function") ? this.inst
			.configTop() : 0;
};
tactile.effects.Slide.prototype = new tactile.effects.Base;
tactile.effects.Slide.prototype.transitionEnd = function(b) {
	var a = tactile.Device.browser.style, c = tactile.effects.Operations;
	if (this.op == c.none) {
		return false;
	}
	if (this.useTransform || this.useTransform3d) {
		this.inst.elem.style[a.transitionProperty] = "";
		this.inst.elem.style[a.transformProperty] = "";
		this.inst.elem.style[a.transitionDuration] = "";
		this.inst.elem.style[a.transitionTimingFunction] = "";
		this.inst.elem.style[this.prop] = this.to + tactile.Enum.Unit.px;
		if (this.op == c.move) {
			tactile.c.U.updateRenderTreeFix(this.inst.elem);
		}
	} else {
		if (this.useTransition) {
			this.inst.elem.style[a.transitionProperty] = "";
			this.inst.elem.style[a.transitionDuration] = "";
			this.inst.elem.style[a.transitionTimingFunction] = "";
			this.inst.elem.style[this.prop] = this.to + tactile.Enum.Unit.px;
		}
	}
	if (this.op == c.hide) {
		this.inst.elem.style.display = tactile.Enum.Display.none;
		if (this.inst.afterhide) {
			this.inst.afterhide.fire({
				targetId : this.inst.id
			});
		}
	} else {
		if (this.op == c.show) {
			if (this.inst.aftershow) {
				this.inst.aftershow.fire({
					targetId : this.inst.id
				});
			}
		}
	}
	this.onend.fire({
		operation : this.op
	});
	this.op = c.none;
};
tactile.effects.Slide.prototype.show = function(e) {
	e = e || {};
	var d = tactile.Device.browser.style, h = tactile.effects.Operations, c = e.slidefrom
			|| tactile.Enum.Direction.east, b;
	if (this.op != h.none) {
		return false;
	}
	if (c == tactile.Enum.Direction.east || c == tactile.Enum.Direction.west) {
		this.prop = tactile.effects.Properties.left;
		b = tactile.effects.Properties.top;
		if (c == tactile.Enum.Direction.east) {
			this.from = this.inst.getParentInnerBox().width + 2
					* this.leftOffset;
		} else {
			this.from = -this.inst.getParentInnerBox().width;
		}
		var a = this.inst.validateNumber(this.inst.configLeft, this.inst
				.getOuterBox());
		if (a) {
			this.to = a;
		} else {
			this.to = this.inst.getParentInnerBox().left;
		}
	} else {
		this.prop = tactile.effects.Properties.top;
		b = tactile.effects.Properties.left;
		if (c == tactile.Enum.Direction.north) {
			this.from = -this.inst.getParentInnerBox().height;
		} else {
			this.from = this.inst.getParentInnerBox().height;
		}
		var f = this.inst.validateNumber(this.inst.configTop, this.inst
				.getParentInnerBox());
		if (f) {
			this.to = f;
		} else {
			this.to = this.inst.getParentInnerBox().top;
		}
	}
	if (this.useTransform || this.useTransform3d) {
		this.op = h.show;
		this.inst.setOpacity(0);
		this.inst.elem.style[b] = (b == tactile.effects.Properties.top) ? this.topOffset
				+ "px"
				: this.leftOffset + "px";
		this.inst.elem.style[this.prop] = this.from + tactile.Enum.Unit.px;
		this.inst.elem.style.display = this.inst.elem.displayStyle;
		this.inst.update(this.inst.getParentInnerBox());
		this.inst.elem.style[d.transitionProperty] = tactile.Device.browser
				.prefixed("transform");
		this.inst.elem.style[d.transitionTimingFunction] = this.timing;
		this.inst.setOpacity(100);
		this.inst.elem.style[d.transitionDuration] = this.duration + "ms";
		if (c == tactile.Enum.Direction.east
				|| c == tactile.Enum.Direction.west) {
			var g = this.from - this.leftOffset;
			if (this.useTransform3d) {
				this.inst.elem.style[d.transformProperty] = "translate3d(" + -g
						+ "px,0px,0px)";
			} else {
				this.inst.elem.style[d.transformProperty] = "translate(" + -g
						+ "px,0px)";
			}
		} else {
			var g = this.from - this.topOffset;
			if (this.useTransform3d) {
				this.inst.elem.style[d.transformProperty] = "translate3d(0px,"
						+ -g + "px,0px)";
			} else {
				this.inst.elem.style[d.transformProperty] = "translate(0px,"
						+ -g + "px)";
			}
		}
		this.setEndEvent();
	} else {
		if (this.useTransition) {
			this.op = h.show;
			this.inst.elem.style[d.transformProperty] = "translateZ(0px)";
			this.inst.elem.style[d.transitionProperty] = this.prop;
			this.inst.elem.style[d.transitionDuration] = this.duration + "ms";
			this.inst.elem.style[d.transitionTimingFunction] = this.timing;
			this.inst.elem.style[b] = (b == tactile.effects.Properties.top) ? this.topOffset
					+ "px"
					: this.leftOffset + "px";
			this.inst.elem.style[this.prop] = this.from + tactile.Enum.Unit.px;
			this.inst.elem.style.display = this.inst.elem.displayStyle;
			this.inst.update(this.inst.getParentInnerBox());
			this.inst.elem.style[this.prop] = this.to + tactile.Enum.Unit.px;
			this.setEndEvent();
		} else {
			this.inst.setOpacity(0);
			this.inst.elem.style.display = this.inst.elem.displayStyle;
			this.inst.update(this.inst.getParentInnerBox());
			this.inst.elem.style[b] = (b == tactile.effects.Properties.top) ? this.topOffset
					+ "px"
					: this.leftOffset + "px";
			this.inst.elem.style[this.prop] = "";
			this.inst.elem.style[this.prop] = this.from + tactile.Enum.Unit.px;
			this.inst.setOpacity(100);
			this.op = h.show;
			this.start = (new Date).getTime();
			this.timer = setInterval(this.step.bind(this), 1000 / this.fps);
		}
	}
	tactile.logger.info(this.toString() + ", show: " + this.inst.id
			+ ", from: " + this.from + ", to: " + this.to);
	return true;
};
tactile.effects.Slide.prototype.hide = function(d) {
	d = d || {};
	var c = tactile.Device.browser.style, g = tactile.effects.Operations, b = d.slideto
			|| tactile.Enum.Direction.west, a;
	if (this.op != g.none) {
		return false;
	}
	if (b == tactile.Enum.Direction.east || b == tactile.Enum.Direction.west) {
		this.prop = tactile.effects.Properties.left;
		if (b == tactile.Enum.Direction.east) {
			this.to = this.inst.getParentBox().width;
		} else {
			this.to = -this.inst.getParentBox().width;
		}
		a = this.inst.validateNumber(this.inst.configLeft, this.inst
				.getParentInnerBox());
		if (a) {
			this.from = a;
		} else {
			this.from = this.inst.getParentInnerBox().left;
		}
	} else {
		this.prop = tactile.effects.Properties.top;
		if (b == tactile.Enum.Direction.north) {
			this.to = -this.inst.getParentBox().height;
		} else {
			this.to = this.inst.getParentBox().height;
		}
		var e = this.inst.validateNumber(this.inst.configTop, this.inst
				.getParentInnerBox());
		if (e) {
			this.from = e;
		} else {
			this.from = this.inst.getParentInnerBox().top;
		}
	}
	this.op = g.hide;
	if (this.useTransform || this.useTransform3d) {
		this.inst.elem.style[c.transitionProperty] = tactile.Device.browser
				.prefixed("transform");
		this.inst.elem.style[c.transitionTimingFunction] = this.timing;
		this.inst.elem.style[c.transitionDuration] = this.duration + "ms";
		var f = this.to;
		if (b == tactile.Enum.Direction.east
				|| b == tactile.Enum.Direction.west) {
			this.to = (b == tactile.Enum.Direction.east) ? this.to
					+ this.leftOffset : this.to - this.leftOffset;
			if (this.useTransform3d) {
				this.inst.elem.style[c.transformProperty] = "translate3d("
						+ this.to + "px,0px,0px)";
			} else {
				this.inst.elem.style[c.transformProperty] = "translate("
						+ this.to + "px,0px)";
			}
		} else {
			this.to = (b == tactile.Enum.Direction.south) ? this.to
					+ this.topOffset : this.to - this.topOffset;
			if (this.useTransform3d) {
				this.inst.elem.style[c.transformProperty] = "translate3d(0px,"
						+ this.to + "px,0px)";
			} else {
				this.inst.elem.style[c.transformProperty] = "translate(0px,"
						+ this.to + "px)";
			}
		}
		this.setEndEvent();
	} else {
		if (this.useTransition) {
			this.to = (b == tactile.Enum.Direction.east) ? this.to + 2
					* this.leftOffset : this.to;
			this.inst.elem.style[c.transitionProperty] = this.prop;
			this.inst.elem.style[c.transitionDuration] = this.duration + "ms";
			this.inst.elem.style[c.transitionTimingFunction] = this.timing;
			this.inst.elem.style[this.prop] = this.to + tactile.Enum.Unit.px;
			this.setEndEvent();
		} else {
			this.to = (b == tactile.Enum.Direction.east) ? this.to + 2
					* this.leftOffset : this.to;
			this.start = (new Date).getTime();
			this.timer = setInterval(this.step.bind(this), this.duration
					/ this.fps);
		}
	}
	tactile.logger.info(this.toString() + ", hide: " + this.inst.id
			+ ", from: " + this.from + ", to: " + this.to);
	return true;
};
tactile.effects.Slide.prototype.move = function(d) {
	d = d || {};
	var c = tactile.Device.browser.style, g = tactile.effects.Operations, b = d.slidedir
			|| tactile.effects.Direction.vertical;
	if (this.op != g.none) {
		return false;
	}
	var a = this.inst.getParentInnerBox();
	if (b == tactile.effects.Direction.horizontal) {
		this.prop = tactile.effects.Properties.left;
		this.to = d.to || a.left;
		this.from = d.from || this.inst.getOuterBox().left;
	} else {
		this.prop = tactile.effects.Properties.top;
		this.to = d.to || a.top;
		this.from = d.from || this.inst.getOuterBox().top;
	}
	if (this.useTransform || this.useTransform3d) {
		this.op = g.move;
		this.inst.elem.style[c.transitionProperty] = tactile.Device.browser
				.prefixed("transform");
		this.inst.elem.style[c.transitionDuration] = this.duration + "ms";
		this.inst.elem.style[c.transitionTimingFunction] = this.timing;
		var f = this.to - this.from;
		var e = "";
		if (b == tactile.effects.Direction.horizontal) {
			e = this.useTransform3d ? "translate3d(" + f + "px, 0px, 0px)"
					: "translate(" + f + "px, 0px)";
			this.inst.elem.style[c.transformProperty] = e;
		} else {
			e = this.useTransform3d ? "translate3d(0px, " + f + "px, 0px)"
					: "translate(0px, " + f + "px)";
			this.inst.elem.style[c.transformProperty] = "translate(0px, " + f
					+ "px)";
		}
		this.setEndEvent();
		if (this.inst instanceof tactile.FlexView) {
			this.inst.flexitems.forEach(function(h) {
				tactile.c.U.applyTransformFlickerFix(h.elem);
			});
		}
	} else {
		if (this.useTransition) {
			this.op = g.move;
			this.inst.elem.style[c.transitionProperty] = this.prop;
			this.inst.elem.style[c.transitionDuration] = this.duration + "ms";
			this.inst.elem.style[c.transitionTimingFunction] = this.timing;
			this.inst.elem.style[this.prop] = this.from + tactile.Enum.Unit.px;
			this.inst.elem.style[this.prop] = this.to + tactile.Enum.Unit.px;
			this.setEndEvent();
		} else {
			this.inst.elem.style[this.prop] = this.from + tactile.Enum.Unit.px;
			this.op = g.move;
			this.start = (new Date).getTime();
			this.timer = setInterval(this.step.bind(this), 1000 / this.fps);
		}
	}
	tactile.logger.info(this.toString() + ", move: " + this.inst.id
			+ ", from: " + this.from + ", to: " + this.to);
	return true;
};
tactile.effects.Slide.prototype.toString = function() {
	var a = "javascript, Frames per sec.: " + this.fps;
	if (this.useTransition) {
		a = "transition";
	}
	if (this.useTransform) {
		a = "transform (2d)";
	}
	if (this.useTransform3d) {
		a = "transform 3d";
	}
	return "Object - tactile.effects.Slide: " + a;
};
tactile.effects.Expand = function(a, b) {
	tactile.effects.Expand.prototype.init.call(this, a, b);
	this.jsstep = function(c) {
		tactile.c.U.updateRenderTreeFix(this.inst.elem);
		this.inst.elem.style[this.prop] = c + tactile.Enum.Unit.px;
	};
	this.onend = new tactile.foundation.Observer();
};
tactile.effects.Expand.prototype = new tactile.effects.Base;
tactile.effects.Expand.prototype.transitionEnd = function() {
	var a = tactile.Device.browser.style, b = tactile.effects.Operations;
	if (this.op == b.hide) {
		this.inst.elem.style.display = tactile.Enum.Display.none;
		if (this.inst.afterhide) {
			this.inst.afterhide.fire({
				targetId : this.inst.id
			});
		}
	} else {
		if (this.op == b.show) {
			if (this.inst.aftershow) {
				this.inst.aftershow.fire({
					targetId : this.inst.id
				});
			}
		}
	}
	this.inst.elem.style[a.transitionProperty] = "";
	this.inst.elem.style[a.transitionDuration] = "";
	this.inst.elem.style[a.transitionTimingFunction] = "";
	this.onend.fire({
		operation : this.op
	});
	this.op = b.none;
};
tactile.effects.Expand.prototype.transitionStart = function() {
	var b = tactile.Device.browser.style, a = this;
	this.inst.elem.style[b.transitionProperty] = this.prop;
	this.inst.elem.style[b.transitionDuration] = this.duration + "ms";
	this.inst.elem.style[b.transitionTimingFunction] = this.timing;
	window.setTimeout(function() {
		a.inst.elem.style[a.prop] = a.to + tactile.Enum.Unit.px;
		a.setEndEvent();
	}, 10);
};
tactile.effects.Expand.prototype.show = function(b) {
	if (this.op != tactile.effects.Operations.none) {
		return false;
	}
	b = b || {};
	var d = b.expand || tactile.Enum.Dimension.width;
	this.from = b.from || 0;
	if (d == tactile.Enum.Dimension.width) {
		this.prop = tactile.effects.Properties.width;
		var a = this.inst.validateNumber(this.inst.configWidth, this.inst
				.getParentInnerBox());
		if (a) {
			this.to = a;
		} else {
			this.to = this.inst.getParentInnerBox().width;
		}
	} else {
		this.prop = tactile.effects.Properties.height;
		var c = this.inst.validateNumber(this.inst.configHeight, this.inst
				.getParentInnerBox());
		if (c) {
			this.to = c;
		} else {
			this.to = this.inst.getParentInnerBox().height;
		}
	}
	if (this.useTransition) {
		this.inst.setOpacity(0);
		this.inst.elem.style.display = this.inst.elem.displayStyle;
		this.inst.update(this.inst.getParentInnerBox());
		this.inst.elem.style[this.prop] = this.from + tactile.Enum.Unit.px;
		this.inst.setOpacity(100);
		this.layoutinit = true;
		this.op = tactile.effects.Operations.show;
		setTimeout(this.transitionStart.bind(this), 50);
	} else {
		this.inst.setOpacity(0);
		this.inst.elem.style.display = this.inst.elem.displayStyle;
		this.inst.update(this.inst.getParentInnerBox());
		this.inst.elem.style[this.prop] = this.from + tactile.Enum.Unit.px;
		this.inst.setOpacity(100);
		this.op = tactile.effects.Operations.show;
		this.start = (new Date).getTime();
		this.timer = setInterval(this.step.bind(this), 1000 / this.fps);
	}
	tactile.logger.info(this.toString() + ", show: " + this.inst.id
			+ ", from: " + this.from + ", to: " + this.to);
	return true;
};
tactile.effects.Expand.prototype.hide = function(b) {
	b = b || {};
	var a = tactile.Device.browser.style, c = tactile.effects.Operations;
	dim = b.expand || tactile.Enum.Dimension.width;
	if (this.op != c.none) {
		return false;
	}
	this.to = b.to || 0;
	if (dim == tactile.Enum.Dimension.width) {
		this.prop = tactile.effects.Properties.width;
		this.from = this.inst.getOuterBox().width;
	} else {
		this.prop = tactile.effects.Properties.height;
		this.from = this.inst.getOuterBox().height;
	}
	if (this.useTransition) {
		this.op = c.hide;
		this.inst.elem.style[a.transitionProperty] = this.prop;
		this.inst.elem.style[a.transitionDuration] = this.duration + "ms";
		this.inst.elem.style[a.transitionTimingFunction] = this.timing;
		this.inst.elem.style[this.prop] = this.to + tactile.Enum.Unit.px;
		this.setEndEvent();
	} else {
		this.op = c.hide;
		this.start = (new Date).getTime();
		this.timer = setInterval(this.step.bind(this), this.duration / this.fps);
	}
	tactile.logger.info(this.toString() + ", hide: " + this.inst.id
			+ ", from: " + this.from + ", to: " + this.to);
	return true;
};
tactile.effects.Expand.prototype.toString = function() {
	var a = "javascript, Frames per sec.: " + this.fps;
	if (this.useTransition) {
		a = "transition";
	}
	return "Object - tactile.effects.Expand: " + a;
};
tactile.effects.Fade = function(a, b) {
	tactile.effects.Fade.prototype.init.call(this, a, b);
	this.jsstep = function(c) {
		this.inst.setOpacity(c);
	};
	this.onend = new tactile.foundation.Observer();
};
tactile.effects.Fade.prototype = new tactile.effects.Base;
tactile.effects.Fade.prototype.transitionEnd = function() {
	var a = tactile.Device.browser.style, b = tactile.effects.Operations;
	if (this.op == b.hide) {
		setTimeout(this.transitionEndHide.bind(this), 50);
		if (this.inst.afterhide) {
			this.inst.afterhide.fire({
				targetId : this.inst.id
			});
		}
	} else {
		if (this.op == b.show) {
			if (this.inst.aftershow) {
				this.inst.aftershow.fire({
					targetId : this.inst.id
				});
			}
		}
	}
	this.inst.elem.style[a.transitionProperty] = "";
	this.inst.elem.style[a.transitionDuration] = "";
	this.inst.elem.style[a.transitionTimingFunction] = "";
	this.onend.fire({
		operation : this.op
	});
	this.op = b.none;
};
tactile.effects.Fade.prototype.transitionEndHide = function() {
	this.inst.elem.style.display = tactile.Enum.Display.none;
};
tactile.effects.Fade.prototype.transitionStart = function() {
	var a = tactile.Device.browser.style;
	this.inst.elem.style[a.transitionProperty] = this.prop;
	this.inst.elem.style[a.transitionDuration] = this.duration + "ms";
	this.inst.elem.style[a.transitionTimingFunction] = this.timing;
	this.inst.setOpacity(this.to);
	this.setEndEvent();
};
tactile.effects.Fade.prototype.show = function(b) {
	var a = tactile.Device.browser.style, c = tactile.effects.Operations;
	if (this.op != c.none) {
		return false;
	}
	b = b || {};
	this.from = b.from || 0;
	this.to = 100;
	this.prop = "opacity";
	if (this.useTransition) {
		this.inst.elem.style[a.transformProperty] = "translateZ(0px)";
		this.inst.setOpacity(0);
		this.inst.elem.style.display = this.inst.elem.displayStyle;
		this.inst.update(this.inst.getParentInnerBox());
		this.op = c.show;
		setTimeout(this.transitionStart.bind(this), 50);
	} else {
		this.inst.setOpacity(0);
		this.inst.elem.style.display = this.inst.elem.displayStyle;
		this.inst.update(this.inst.getParentInnerBox());
		this.op = c.show;
		this.start = (new Date).getTime();
		this.timer = setInterval(this.step.bind(this), 1000 / this.fps);
	}
	tactile.logger.info(this.toString() + ", show: " + this.inst.id
			+ ", from: " + this.from + ", to: " + this.to);
	return true;
};
tactile.effects.Fade.prototype.hide = function(b) {
	b = b || {};
	var a = tactile.Device.browser.style, d = tactile.effects.Operations, c = b.expand
			|| tactile.Enum.Dimension.width;
	if (this.op != d.none) {
		return false;
	}
	this.to = b.to || 0;
	this.from = 100;
	this.prop = "opacity";
	if (this.useTransition) {
		this.inst.elem.style[a.transformProperty] = "translateZ(0px)";
		this.op = d.hide;
		this.inst.elem.style[a.transitionProperty] = this.prop;
		this.inst.elem.style[a.transitionDuration] = this.duration + "ms";
		this.inst.elem.style[a.transitionTimingFunction] = this.timing;
		this.inst.setOpacity(this.to);
		this.setEndEvent();
	} else {
		this.op = d.hide;
		this.start = (new Date).getTime();
		this.timer = setInterval(this.step.bind(this), this.duration / this.fps);
	}
	tactile.logger.info(this.toString() + ", hide: " + this.inst.id
			+ ", from: " + this.from + ", to: " + this.to);
	return true;
};
tactile.effects.Fade.prototype.toString = function() {
	var a = "javascript, ";
	if (this.useTransition) {
		a = "transition";
	}
	return "Object - tactile.effects.Fade: " + a;
};
tactile.foundation.Observer = function() {
	this.fns = [];
};
tactile.foundation.Observer.prototype = {
	subscribe : function(c, b) {
		var a = b || window;
		this.fns.push({
			fn : c,
			scope : a
		});
	},
	unsubscribe : function(a) {
		this.fns = this.fns.filter(function(b) {
			if (b.fn !== a) {
				return b;
			}
		});
	},
	fire : function(b, a) {
		this.fns.forEach(function(d) {
			var c = a || d.scope;
			d.fn.call(c, b);
		});
	}
};
tactile.foundation.Scroller = function(a, d) {
	if (a instanceof tactile.View == false
			&& a instanceof tactile.FlexView == false) {
		throw "Error - type mismatch: tactile.foundation.Scroller expects constructor argument of type tactile.View or tactile.FlexView!";
	}
	if (!a.parent || !a.parent instanceof tactile.foundation.UIContainer) {
		throw "Error: a scroll view needs to have a parent UIContainer!";
	}
	if (!d) {
		throw "Error: a Scroller needs to have a config object!";
	}
	this.view = a;
	this.elem = a.elem;
	this.parent = a.parent;
	this.touchId = null;
	this.onstart = new tactile.foundation.Observer();
	this.onscroll = new tactile.foundation.Observer();
	this.onend = new tactile.foundation.Observer();
	this.getDirection = undefined;
	if (typeof d.scroll === "function") {
		this.getDirection = d.scroll;
	} else {
		if (tactile.Enum.contains(tactile.Enum.Scroll, d.scroll)) {
			this.getDirection = function() {
				return tactile.Enum.getValue(tactile.Enum.Scroll, d.scroll);
			};
		} else {
			this.getDirection = function() {
				return tactile.Enum.Scroll.vertical;
			};
		}
	}
	this.state = this.validDirection();
	var c = {
		direction : d.scroll
	};
	if (d.scrollbar) {
		c = d.scrollbar;
	}
	if (d.scrollbar && d.scrollbar.direction === undefined) {
		c.direction = d.scroll;
	}
	if (c.direction != tactile.Enum.Scroll.disabled) {
		this.scrollbar = new tactile.foundation.ScrollBar(this, c);
	}
	this.useTransform = tactile.Device.browser.csstransforms;
	this.useTransform3d = tactile.Device.browser.csstransforms3d
			&& tactile.Device.platform === "ios";
	if (typeof nbdevice === "object"
			&& typeof nbdevice.tactilescrollermethod === "object") {
		var f = nbdevice.tactilescrollermethod.toLowerCase();
		if (nbdevice.tactilescrollermethod) {
			this.useTransform = (f === tactile.effects.Method.transform);
			this.useTransform3d = (f === tactile.effects.Method.transform3d);
		}
	}
	if (d.method && d.method == tactile.effects.Method.javascript) {
		this.useTransform = false;
		this.useTransform3d = false;
	}
	if (d.method && d.method == tactile.effects.Method.transform) {
		this.useTransform = true;
		this.useTransform3d = false;
	}
	if (d.method && d.method == tactile.effects.Method.transform3d) {
		this.useTransform = false;
		this.useTransform3d = true;
	}
	if (!this.useTransform && !this.useTransform3d) {
		this.elem.style.position = "absolute";
	}
	var e = 25;
	if (tactile.Device.platform === "ios" && tactile.Device.version >= 3) {
		e = 100;
	}
	this.fps = d.fps || e;
	this.frameinterval = 1000 / this.fps;
	this.previousTime = 0;
	this.duration = 1000;
	this.transition = d.transition || tactile.effects.Transitions.outQuad;
	this.offset = {
		x : 0,
		y : 0
	};
	this.start = {
		x : 0,
		y : 0
	};
	this.from = {
		x : 0,
		y : 0
	};
	this.to = {
		x : 0,
		y : 0
	};
	this.timer = {
		x : null,
		y : null
	};
	this.startTime = {
		x : null,
		y : null
	};
	var b = this;
	this.elem.me = b;
	tactile.events.TouchEventManager.addListener(this.elem, "scrollstart",
			b.onScrollStart);
	tactile.events.TouchEventManager.addListener(this.elem, "scroll",
			b.onScrollMove);
	tactile.events.TouchEventManager.addListener(this.elem, "scrollend",
			b.onScrollEnd);
	tactile.events.TouchEventManager.addListener(this.elem, "touchmove",
			b.onTouchMove);
	this.view.onresize.subscribe(this.update, this);
	this.checkLimits();
};
tactile.foundation.Scroller.prototype.validDirection = function() {
	var b, a;
	a = "vertical";
	try {
		b = this.getDirection();
	} catch (c) {
		tactile.logger.error(this.id
				+ ".getDirection() has thrown an exception: " + c);
	}
	if (tactile.Enum.contains(tactile.Enum.Scroll, b)) {
		a = b;
	} else {
		tactile.logger.error(this.id + ".getDirection(): TypeError (" + b
				+ " is not a valid direction)");
	}
	return a;
};
tactile.foundation.Scroller.prototype.scrollVertical = function() {
	if (this.validDirection() == tactile.Enum.Scroll.vertical
			|| this.validDirection() == tactile.Enum.Scroll.both) {
		return true;
	} else {
		return false;
	}
};
tactile.foundation.Scroller.prototype.scrollHorizontal = function() {
	if (this.validDirection() == tactile.Enum.Scroll.horizontal
			|| this.validDirection() == tactile.Enum.Scroll.both) {
		return true;
	} else {
		return false;
	}
};
tactile.foundation.Scroller.prototype.scrollBoth = function() {
	if (this.validDirection() == tactile.Enum.Scroll.both) {
		return true;
	} else {
		return false;
	}
};
tactile.foundation.Scroller.prototype.checkLimits = function() {
	var c = this.parent.getInnerBox();
	var a = -this.elem.scrollWidth + Math.round(0.5 * c.width);
	var b = Math.round(0.5 * c.width);
	var d = Math.round(0.5 * c.height);
	var e = -this.elem.scrollHeight + c.height - Math.round(0.5 * c.height);
	this.limits = {
		minLeft : a,
		maxLeft : b,
		minTop : e,
		maxTop : d
	};
};
tactile.foundation.Scroller.prototype.onScrollStart = function(b) {
	var a = this.me;
	if (b.browserEvent && b.browserEvent.touches) {
		if (b.browserEvent.touches.length > 1 && a.touchId != null
				&& b.browserEvent.touches[1].identifier != a.touchId) {
			return;
		}
		a.touchId = b.browserEvent.touches[0].identifier;
	}
	a.checkLimits();
	a.start.x = b.pageX - a.offset.x;
	a.start.y = b.pageY - a.offset.y;
	a.previousTime = b.timeStamp;
	if (a.timer.x) {
		clearInterval(a.timer.x);
		a.timer.x = null;
	}
	if (a.timer.y) {
		clearInterval(a.timer.y);
		a.timer.y = null;
	}
	a.onstart.fire({
		offsetX : a.offset.x,
		offsetY : a.offset.y
	});
};
tactile.foundation.Scroller.prototype.onScrollMove = function(d) {
	var b = this.me, c = tactile.Device.browser.style, a;
	if (d.browserEvent && d.browserEvent.touches) {
		if (d.browserEvent.touches.length > 1 && b.touchId != null
				&& d.browserEvent.touches[1].identifier != b.touchId) {
			return;
		}
		b.touchId = d.browserEvent.touches[0].identifier;
	}
	if (b.scrollVertical()
			&& (b.offset.y >= b.limits.maxTop || b.offset.y <= b.limits.minTop)) {
		return;
	}
	if (b.scrollHorizontal()
			&& (b.offset.x >= b.limits.maxLeft || b.offset.x <= b.limits.minLeft)) {
		return;
	}
	if (d.timeStamp - b.previousTime >= b.frameinterval) {
		b.previousTime = d.timeStamp;
		b.offset.x = d.pageX - b.start.x;
		b.offset.y = d.pageY - b.start.y;
		if (b.useTransform || b.useTransform3d) {
			a = 0 + tactile.Enum.Unit.px, ty = 0 + tactile.Enum.Unit.px;
			if (b.scrollHorizontal()) {
				a = b.offset.x + tactile.Enum.Unit.px;
			}
			if (b.scrollVertical()) {
				ty = b.offset.y + tactile.Enum.Unit.px;
			}
			if (b.useTransform3d) {
				b.elem.style[c.transformProperty] = "translate3d(" + a + ", "
						+ ty + ",0px)";
			} else {
				b.elem.style[c.transformProperty] = "translate(" + a + ", "
						+ ty + ")";
			}
		} else {
			if (b.scrollHorizontal()) {
				b.elem.style.left = b.offset.x + tactile.Enum.Unit.px;
			}
			if (b.scrollVertical()) {
				b.elem.style.top = Math.round(b.offset.y)
						+ tactile.Enum.Unit.px;
			}
		}
		b.onscroll.fire({
			offsetX : b.offset.x,
			offsetY : b.offset.y
		});
	}
};
tactile.foundation.Scroller.prototype.scrollBack = function() {
	var a = this.parent.getInnerBox();
	var c = {
		x : this.offset.x,
		y : this.offset.y
	};
	var b = {
		x : a.left,
		y : a.top
	};
	this.scroll(c, b);
};
tactile.foundation.Scroller.prototype.reset = function() {
	var b = this.parent.getInnerBox(), d = 0, c = 0, a = tactile.Device.browser.style;
	if (this.scrollBoth()) {
		d = b.left;
		c = b.top;
		this.offset.x = 0;
		this.offset.y = 0;
		if (!this.useTransform3d && !this.useTransform) {
			this.elem.style.left = d + tactile.Enum.Unit.px;
			this.elem.style.top = c + tactile.Enum.Unit.px;
		}
	} else {
		if (this.scrollVertical()) {
			c = b.top;
			this.offset.y = 0;
			if (!this.useTransform3d && !this.useTransform) {
				this.elem.style.top = c + tactile.Enum.Unit.px;
			}
		} else {
			d = b.left;
			this.offset.x = 0;
			if (!this.useTransform3d && !this.useTransform) {
				this.elem.style.left = d + tactile.Enum.Unit.px;
			}
		}
	}
	if (this.useTransform3d) {
		this.elem.style[a.transformProperty] = "translate3d(0px,0px,0px)";
	} else {
		if (this.useTransform) {
			this.elem.style[a.transformProperty] = "translate(0px,0px)";
		}
	}
};
tactile.foundation.Scroller.prototype.onScrollEnd = function(g) {
	var a = this.me;
	var d = {
		x : g.deltaX / g.deltaTime,
		y : g.deltaY / g.deltaTime
	};
	var f = Math.abs(d.y) * a.duration * 0.7;
	if (a.scrollVertical() && !a.scrollBoth()) {
		if (Math.abs(d.y) < 0.3) {
			a.onComplete();
			return;
		}
	} else {
		if (a.scrollHorizontal() && !a.scrollBoth()) {
			if (Math.abs(d.x) < 0.3) {
				a.onComplete();
				return;
			}
		}
	}
	var c = Math.round(d.x * f);
	var b = Math.round(d.y * f);
	var i = {
		x : a.offset.x,
		y : a.offset.y
	};
	var h = {
		x : i.x + c,
		y : i.y + b
	};
	a.scroll(i, h);
};
tactile.foundation.Scroller.prototype.onComplete = function() {
	var a = this.parent.getInnerBox();
	if (this.scrollVertical()) {
		if (this.offset.y > 0) {
			this.to.y = 0;
			this.scroll(this.offset, this.to);
		} else {
			if ((this.elem.scrollHeight > a.height)
					&& (this.offset.y < -this.elem.scrollHeight + a.height)) {
				this.to.y = -this.elem.scrollHeight + a.height;
				this.scroll(this.offset, this.to);
			}
		}
	}
	if (this.scrollHorizontal()) {
		if (this.offset.x > 0) {
			this.to.x = 0;
			this.scroll(this.offset, this.to);
		} else {
			if ((this.elem.scrollWidth > a.width)
					&& (this.offset.x < -this.elem.scrollWidth + a.width)) {
				this.to.x = -this.elem.scrollWidth + a.width;
				this.scroll(this.offset, this.to);
			}
		}
	}
	this.onend.fire({
		offsetX : this.offset.x,
		offsetY : this.offset.y
	});
};
tactile.foundation.Scroller.prototype.scroll = function(c, b) {
	if (this.elem.timer !== undefined) {
		return;
	}
	var a = this.parent.getInnerBox();
	this.from = c;
	if (this.scrollVertical()) {
		if (b.y > 0) {
			this.to.y = 0;
		} else {
			if (b.y <= this.limits.minTop) {
				this.to.y = -this.elem.scrollHeight + a.height;
			} else {
				this.to.y = b.y;
			}
		}
		this.startTime.y = (new Date()).getTime();
		this.timer.y = setInterval(this.step.bind(this), this.frameinterval);
	}
	if (this.scrollHorizontal()) {
		if (b.x > 0) {
			this.to.x = 0;
		} else {
			if (b.x <= this.limits.minLeft) {
				this.to.x = -this.elem.scrollWidth + a.width;
			} else {
				this.to.x = b.x;
			}
		}
		if (this.to.x != this.offset.x) {
			this.startTime.x = (new Date()).getTime();
			this.timer.x = setInterval(this.step.bind(this), this.frameinterval);
		}
	}
};
tactile.foundation.Scroller.prototype.move = function(g) {
	var b = this.parent.getBox();
	var d = {
		x : undefined,
		y : undefined
	};
	var f = {
		x : this.offset.x,
		y : this.offset.y
	};
	if (typeof g === "string") {
		var a = document.getElementById(g);
		if (a) {
			var e = {
				x : 0,
				y : 0
			};
			var c = this;
			while (c.parent) {
				e.x += c.parent.getBox().left;
				e.y += c.parent.getBox().top;
				c = c.parent;
			}
			d = {
				x : -tactile.c.E.getOffsetLeft(a) + e.x,
				y : -tactile.c.E.getOffsetTop(a) + e.y
			};
		} else {
			tactile.logger.info(this.toString() + ", show: " + this.inst.id
					+ ", from: " + this.from + ", to: " + this.to);
			tactile.logger.error(message);
		}
	} else {
		if (!isNaN(g.x) && !isNaN(g.y)) {
			d = {
				x : this.offset.x + g.x,
				y : this.offset.y + g.y
			};
		}
	}
	if (!isNaN(d.x) && !isNaN(d.y)) {
		this.scroll(f, d);
	}
};
tactile.foundation.Scroller.prototype.step = function() {
	var d, a, c, b = tactile.Device.browser.style;
	if (this.scrollVertical() && this.timer.y != null) {
		d = (new Date()).getTime();
		if (d >= this.duration + this.startTime.y) {
			c = this.to.y;
			clearInterval(this.timer.y);
			this.timer.y = null;
			setTimeout(this.onComplete.bind(this), 20);
		} else {
			a = (d - this.startTime.y) / (this.duration);
			c = Math.round(this.transition(a) * (this.to.y - this.from.y)
					+ this.from.y);
		}
		this.offset.y = c;
		if (this.useTransform || this.useTransform3d) {
			if (this.useTransform3d) {
				if (this.scrollBoth()) {
					this.elem.style[b.transformProperty] = "translate3d("
							+ this.offset.x + tactile.Enum.Unit.px + ","
							+ this.offset.y + tactile.Enum.Unit.px + ",0px)";
				} else {
					this.elem.style[b.transformProperty] = "translate3d(0"
							+ tactile.Enum.Unit.px + "," + this.offset.y
							+ tactile.Enum.Unit.px + ",0px)";
				}
			} else {
				if (this.scrollBoth()) {
					this.elem.style[b.transformProperty] = "translate("
							+ this.offset.x + tactile.Enum.Unit.px + ","
							+ this.offset.y + tactile.Enum.Unit.px + ")";
				} else {
					this.elem.style[b.transformProperty] = "translate(0"
							+ tactile.Enum.Unit.px + "," + this.offset.y
							+ tactile.Enum.Unit.px + ")";
				}
			}
		} else {
			this.elem.style.top = this.offset.y + tactile.Enum.Unit.px;
		}
	}
	if (this.scrollHorizontal() && this.timer.x != null) {
		d = (new Date()).getTime();
		if (d >= this.duration + this.startTime.x) {
			c = this.to.x;
			clearInterval(this.timer.x);
			this.timer.x = null;
			setTimeout(this.onComplete.bind(this), 20);
		} else {
			a = (d - this.startTime.x) / (this.duration);
			c = Math.round(this.transition(a) * (this.to.x - this.from.x)
					+ this.from.x);
		}
		this.offset.x = c;
		if (this.useTransform || this.useTransform3d) {
			if (this.useTransform3d) {
				if (this.scrollBoth()) {
					this.elem.style[b.transformProperty] = "translate3d("
							+ this.offset.x + tactile.Enum.Unit.px + ","
							+ this.offset.y + tactile.Enum.Unit.px + ",0px)";
				} else {
					this.elem.style[b.transformProperty] = "translate3d("
							+ this.offset.x + tactile.Enum.Unit.px + ",0"
							+ tactile.Enum.Unit.px + ",0px)";
				}
			} else {
				if (this.scrollBoth()) {
					this.elem.style[b.transformProperty] = "translate("
							+ this.offset.x + tactile.Enum.Unit.px + ","
							+ this.offset.y + tactile.Enum.Unit.px + ")";
				} else {
					this.elem.style[b.transformProperty] = "translate("
							+ this.offset.x + tactile.Enum.Unit.px + ",0"
							+ tactile.Enum.Unit.px + ")";
				}
			}
		} else {
			this.elem.style.left = c + tactile.Enum.Unit.px;
		}
	}
	this.onscroll.fire({
		offsetX : this.offset.x,
		offsetY : this.offset.y
	});
};
tactile.foundation.Scroller.prototype.update = function() {
	var a = this.validDirection(), b = tactile.Device.browser.style;
	if (a != tactile.Enum.Scroll.disabled) {
		if (this.state != a) {
			if (this.useTransform || this.useTransform3d) {
				this.elem.style[b.transformProperty] = "";
			} else {
				if (a = tactile.Enum.Scroll.vertical) {
					this.elem.style.left = "0px";
				} else {
					if (a = tactile.Enum.Scroll.horizontal) {
						this.elem.style.top = "0px";
					}
				}
			}
		}
		this.onComplete();
	} else {
		if (this.useTransform || this.useTransform3d) {
			this.elem.style[b.transformProperty] = "";
		} else {
			this.elem.style.left = "0px";
			this.elem.style.top = "0px";
		}
	}
	this.state = a;
};
tactile.foundation.Scroller.prototype.onTouchMove = function(a) {
	a.browserEvent.preventDefault();
	a.browserEvent.stopPropagation();
};
tactile.foundation.Scroller.prototype.onTouchStart = function(a) {
	a.browserEvent.preventDefault();
	a.browserEvent.stopPropagation();
};
tactile.foundation.Scroller.prototype.toString = function() {
	var a = "javascript (style)";
	var a = "javascript (style)";
	if (this.useTransform3d) {
		a = "transform 3d";
	} else {
		if (this.useTransform) {
			a = "transform (2d)";
		}
	}
	return "Object - tactile.foundation.Scroller. Method: " + a
			+ ", Frames per sec.: " + this.fps;
};
tactile.foundation.ScrollBar = function(a, b) {
	if (!a instanceof tactile.foundation.Scroller) {
		throw "Error - type mismatch: tactile.foundation.ScrollBar expects constructor argument of type tactile.foundation.Scroller!";
	}
	this.scroller = a;
	this.scrollBarFixed = false;
	var c = document.createElement("div");
	c.style.position = tactile.Enum.Position.absolute;
	c.style.backgroundColor = b.color || "#cccccc";
	c.style.zIndex = (tactile.c.E.getZindex(this.scroller.elem) + 1).toString();
	c.style[tactile.Device.browser.style.borderRadius] = "2"
			+ tactile.Enum.Unit.em;
	tactile.c.E.setOpacity(c, 0);
	this.vBar = c.cloneNode(true);
	this.hBar = c.cloneNode(true);
	if (typeof b.direction === "function") {
		this.getDirection = b.direction;
	} else {
		if (tactile.Enum.contains(tactile.Enum.Scroll, b.direction)) {
			this.getDirection = function() {
				return tactile.Enum.getValue(tactile.Enum.Scroll, b.direction);
			};
		} else {
			this.getDirection = function() {
				return tactile.Enum.Scroll.vertical;
			};
		}
	}
	this.weight = b.weight ? b.weight : 5;
	this.scroller.onstart.subscribe(this.onStart, this);
	this.scroller.onscroll.subscribe(this.onScroll, this);
	this.scroller.onend.subscribe(this.onEnd, this);
};
tactile.foundation.ScrollBar.prototype.validDirection = function() {
	var b, a;
	a = "vertical";
	b = this.getDirection();
	if (tactile.Enum.contains(tactile.Enum.Scroll, b)) {
		a = b;
	}
	return a;
};
tactile.foundation.ScrollBar.prototype.fixScrollbar = function() {
	this.scroller.parent.elem.appendChild(this.vBar);
	this.scroller.parent.elem.appendChild(this.hBar);
	this.scrollBarFixed = true;
};
tactile.foundation.ScrollBar.prototype.scrollVertical = function() {
	if (this.validDirection() == tactile.Enum.Scroll.vertical
			|| this.validDirection() == tactile.Enum.Scroll.both) {
		return true;
	} else {
		return false;
	}
};
tactile.foundation.ScrollBar.prototype.scrollHorizontal = function() {
	if (this.validDirection() == tactile.Enum.Scroll.horizontal
			|| this.validDirection() == tactile.Enum.Scroll.both) {
		return true;
	} else {
		return false;
	}
};
tactile.foundation.ScrollBar.prototype.getZindex = function() {
	var b, a = 0;
	var c = this.scroller.elem;
	b = tactile.c.E.getCurrStyle(c, "z-index");
	if (Number(b)) {
		a = Number(b);
	}
	return a + 1;
};
tactile.foundation.ScrollBar.prototype.onStart = function(c) {
	if (!this.scrollBarFixed) {
		this.fixScrollbar();
	}
	var b = this.scroller.parent.getBox();
	this.vertRatio = b.height * 100 / this.scroller.elem.scrollHeight;
	this.horizRatio = b.width * 100 / this.scroller.elem.scrollWidth;
	var a = b.height * this.vertRatio / 100;
	var d = b.width * this.horizRatio / 100;
	if (this.scrollVertical()) {
		this.vBar.style.width = this.weight + tactile.Enum.Unit.px;
		this.vBar.style.height = a + tactile.Enum.Unit.px;
		this.vBar.style.top = (this.vBar.offsetTop + b.top)
				+ tactile.Enum.Unit.px;
		this.vBar.style.left = (this.scroller.elem.offsetLeft
				+ this.scroller.elem.scrollWidth - this.vBar.offsetWidth - 2)
				+ tactile.Enum.Unit.px;
		tactile.c.E.setOpacity(this.vBar, 60);
	}
	if (this.scrollHorizontal()) {
		this.hBar.style.left = (this.hBar.offsetLeft + b.left)
				+ tactile.Enum.Unit.px;
		this.hBar.style.top = (b.height - 5) + tactile.Enum.Unit.px;
		this.hBar.style.width = d + tactile.Enum.Unit.px;
		this.hBar.style.height = this.weight + tactile.Enum.Unit.px;
		tactile.c.E.setOpacity(this.hBar, 60);
	}
};
tactile.foundation.ScrollBar.prototype.onScroll = function(d) {
	var b = Math.round(d.offsetX * this.horizRatio / 100);
	var a = Math.round(d.offsetY * this.vertRatio / 100);
	var c = this.scroller.parent.getBox();
	if (this.scrollVertical()) {
		if (this.scroller.offset.y >= 0) {
			this.vBar.style.top = 0 + tactile.Enum.Unit.px;
		} else {
			if (this.scroller.offset.y <= -this.scroller.elem.scrollHeight
					+ c.height) {
				this.vBar.style.top = (c.height - this.vBar.offsetHeight)
						+ tactile.Enum.Unit.px;
			} else {
				this.vBar.style.top = -a + tactile.Enum.Unit.px;
			}
		}
	}
	if (this.scrollHorizontal()) {
		if (this.scroller.offset.x >= 0) {
			this.hBar.style.left = 0 + tactile.Enum.Unit.px;
		} else {
			if (this.scroller.offset.x <= -this.scroller.elem.scrollWidth
					+ c.width) {
				this.hBar.style.left = (c.width - this.hBar.offsetWidth)
						+ tactile.Enum.Unit.px;
			} else {
				this.hBar.style.left = -b + tactile.Enum.Unit.px;
			}
		}
	}
};
tactile.foundation.ScrollBar.prototype.onEnd = function(a) {
	if (this.scrollVertical()) {
		tactile.c.E.setOpacity(this.vBar, 0);
	}
	if (this.scrollHorizontal()) {
		tactile.c.E.setOpacity(this.hBar, 0);
	}
};
tactile.foundation.Element = function() {
	this.elem = undefined;
	this.init = function(a) {
		if (typeof a === "string") {
			this.elem = document.getElementById(a);
		} else {
			this.elem = a;
		}
		if (!this.elem) {
			throw "Error - " + this + ": element not specified! (argument: "
					+ a + ")";
		}
		this.elem.displayStyle = this.elem.style.display;
	};
};
tactile.foundation.Element.prototype.hide = function(a) {
	this.elem.style.display = tactile.Enum.Display.none;
};
tactile.foundation.Element.prototype.show = function() {
	this.elem.style.display = this.elem.displayStyle;
};
tactile.foundation.Element.prototype.toggle = function() {
	if (this.elem.style.display == tactile.Enum.Display.none) {
		this.show();
	} else {
		this.hide();
	}
};
tactile.foundation.Element.prototype.setOpacity = function(a) {
	tactile.c.E.setOpacity(this.elem, a);
};
tactile.foundation.Element.prototype.getOpacity = function() {
	return tactile.c.E.getOpacity(this.elem);
};
tactile.foundation.Element.prototype.addClass = function(a) {
	tactile.c.E.addClass(this.elem, a);
};
tactile.foundation.Element.prototype.removeClass = function(a) {
	tactile.c.E.removeClass(this.elem, a);
};
tactile.foundation.Element.prototype.replaceClass = function(b, a) {
	tactile.c.E.replaceClass(this.elem, b, a);
};
tactile.foundation.Element.prototype.toggleClass = function(a) {
	tactile.c.E.toggleClass(this.elem, a);
};
tactile.foundation.Element.prototype.swapClass = function(b, a) {
	tactile.c.E.swapClass(this.elem, b, a);
};
tactile.foundation.Element.prototype.isVisible = function() {
	return (this.elem.style.display != tactile.Enum.Display.none)
			&& (tactile.c.E.getCurrStyle(this.elem, "display") != tactile.Enum.Display.none);
};
tactile.foundation.UIElement = function(a) {
	tactile.foundation.UIElement.prototype.init.call(this, a);
};
tactile.foundation.UIElement.prototype = new tactile.foundation.Element();
tactile.foundation.UIElement.prototype.toString = function() {
	return "Object - tactile.foundation.UIElement";
};
tactile.foundation.UIComponent = function() {
	this.effect = undefined;
	this.aftershow = undefined;
	this.beforeshow = undefined;
	this.afterhide = undefined;
	this.beforehide = undefined;
	this.init = function(a) {
		tactile.foundation.UIComponent.prototype.init.call(this, a);
		if (this.elem.id) {
			this.id = this.elem.id;
		} else {
			this.id = this.elem.id = tactile.foundation.UIComponent.getNewId();
		}
		tactile.foundation.UIComponent.components[this.id] = this;
	};
};
tactile.foundation.UIComponent.prototype = new tactile.foundation.Element();
tactile.foundation.UIComponent.idSeed = 0;
tactile.foundation.UIComponent.getNewId = function() {
	return "UID_" + (tactile.foundation.UIComponent.idSeed += 1);
};
tactile.foundation.UIComponent.components = {};
tactile.foundation.UIComponent.prototype.hide = function(a) {
	if (this.effect && this.effect.hide) {
		if (this.effect.op == tactile.effects.Operations.none) {
			if (this.beforehide) {
				this.beforehide.fire({
					targetId : this.id
				});
			}
			this.effect.hide(a);
		}
	} else {
		if (this.beforehide) {
			this.beforehide.fire({
				targetId : this.id
			});
		}
		this.elem.style.display = tactile.Enum.Display.none;
		if (this.afterhide) {
			this.afterhide.fire({
				targetId : this.id
			});
		}
	}
};
tactile.foundation.UIComponent.prototype.show = function(a) {
	if (this.effect && this.effect.show) {
		if (this.effect.op == tactile.effects.Operations.none) {
			if (this.beforeshow) {
				this.beforeshow.fire({
					targetId : this.id
				});
			}
			this.effect.show(a);
		}
	} else {
		if (this.beforeshow) {
			this.beforeshow.fire({
				targetId : this.id
			});
		}
		this.elem.style.display = this.elem.displayStyle;
		if (this.aftershow) {
			this.aftershow.fire({
				targetId : this.id
			});
		}
	}
};
tactile.foundation.UIComponent.prototype.toggle = function(a) {
	if (this.elem.style.display == tactile.Enum.Display.none) {
		this.show(a);
	} else {
		this.hide(a);
	}
};
tactile.foundation.UIComponent.prototype.append = function(a) {
	if (a instanceof tactile.foundation.UIComponent) {
		this.elem.appendChild(a.elem);
	} else {
		tactile.logger
				.error(this.id
						+ " Type mismatch: tactile.foundation.UIComponent.append  expects argument of type tactile.foundation.UIComponent!");
	}
};
tactile.foundation.UIComponent.prototype.remove = function(a) {
	if (a instanceof tactile.foundation.UIComponent) {
		try {
			this.elem.removeChild(a.elem);
			if (tactile.foundation.UIComponent.components[a.id]) {
				delete tactile.foundation.UIComponent.components[a.id];
			}
		} catch (b) {
			tactile.logger
					.error("tactile.foundation.UIComponent.remove  the component is not a child of "
							+ this.id);
		}
	} else {
		tactile.logger
				.error(this.id
						+ " Type mismatch: tactile.foundation.UIComponent.remove  expects argument of type tactile.foundation.UIComponent!");
	}
};
tactile.foundation.UIContainer = function() {
	this.parent = undefined;
	this.configWidth = undefined;
	this.configHeight = undefined;
	this.configTop = undefined;
	this.configLeft = undefined;
	this.configVisible = undefined;
	this.onresize = undefined;
	this.onstatechange = undefined;
	this.init = function(c, a) {
		tactile.foundation.UIContainer.prototype.init.call(this, c);
		a = a || {};
		if (a.width) {
			if (typeof a.width === "function") {
				this.configWidth = a.width;
			} else {
				if (!isNaN(a.width)) {
					this.configWidth = function(d) {
						return a.width;
					};
				}
			}
		}
		if (a.height) {
			if (typeof a.height === "function") {
				this.configHeight = a.height;
			} else {
				if (!isNaN(a.height)) {
					this.configHeight = function(d) {
						return a.height;
					};
				}
			}
		}
		if (a.top) {
			if (typeof a.top === "function") {
				this.configTop = a.top;
			} else {
				if (!isNaN(a.top)) {
					this.configTop = function(d) {
						return a.top;
					};
				}
			}
		}
		if (a.left) {
			if (typeof a.left === "function") {
				this.configLeft = a.left;
			} else {
				if (!isNaN(a.left)) {
					this.configLeft = function(d) {
						return a.left;
					};
				}
			}
		}
		if (a.visible !== undefined) {
			if (typeof a.visible === "function") {
				this.configVisible = a.visible;
			}
		}
		if (a.effect) {
			var b = undefined;
			if (a.effect.type && a.effect.type == tactile.Enum.Effects.slide) {
				b = new tactile.effects.Slide(this, a.effect);
			} else {
				if (a.effect.type
						&& a.effect.type == tactile.Enum.Effects.expand) {
					b = new tactile.effects.Expand(this, a.effect);
				} else {
					if (a.effect.type
							&& a.effect.type == tactile.Enum.Effects.fade) {
						b = new tactile.effects.Fade(this, a.effect);
					}
				}
			}
			this.effect = b;
			tactile.logger.info(this.toString() + ", effect: "
					+ this.effect.toString());
		}
		if (a.position
				&& tactile.Enum.contains(tactile.Enum.Position, a.position)) {
			this.elem.style.position = tactile.Enum.getValue(
					tactile.Enum.Position, a.position);
		}
		if (a.overflow
				&& tactile.Enum.contains(tactile.Enum.Overflow, a.overflow)) {
			this.elem.style.overflow = tactile.Enum.getValue(
					tactile.Enum.Overflow, a.overflow);
		}
		if (a.zindex && !isNaN(a.zindex)) {
			this.elem.style.zIndex = a.zindex;
		}
		if (a.display && tactile.Enum.contains(tactile.Enum.Display, a.display)) {
			this.elem.style.display = tactile.Enum.getValue(
					tactile.Enum.Display, a.display);
		}
		if (a.float && tactile.Enum.contains(tactile.Enum.Float, a.float)) {
			this.elem.style.float = tactile.Enum.getValue(tactile.Enum.Float,
					a.float);
		}
		if (a.opacity && !isNaN(a.opacity)) {
			this.setOpacity(a.opacity);
		}
	};
};
tactile.foundation.UIContainer.prototype = new tactile.foundation.UIComponent();
tactile.foundation.UIContainer.prototype.validateNumber = function(b, d) {
	var a = null;
	if (b) {
		try {
			a = b.call(this, d);
		} catch (c) {
			tactile.logger.error(this.id + ".validateNumber(" + b + ", " + d
					+ ") has thrown an exception: " + c);
		}
		if (!isNaN(a)) {
			return a;
		} else {
			tactile.logger.error(this.id + ".validateNumber(" + b + ", " + d
					+ ") did not return a number!");
			a = null;
		}
	}
	return a;
};
tactile.foundation.UIContainer.prototype.validateVisible = function() {
	var a = true;
	if (this.configVisible) {
		try {
			a = this.configVisible();
		} catch (b) {
			tactile.logger.error(this.id + ".validateVisible("
					+ this.configVisible + ") has thrown an exception: " + b);
			a = true;
		}
		if (typeof a === "boolean") {
			return a;
		} else {
			tactile.logger.error(this.id + ".validateVisible("
					+ this.configVisible + ") did not return a boolean value!");
			a = true;
		}
		if (!a) {
			tactile.logger.warn(this.id + ".validateVisible returned false!");
		}
	}
	return a;
};
tactile.foundation.UIContainer.prototype.getBox = function() {
	var a = {
		top : this.elem.offsetTop,
		left : this.elem.offsetLeft,
		width : this.elem.offsetWidth,
		height : this.elem.offsetHeight
	};
	return a;
};
tactile.foundation.UIContainer.prototype.getParentBox = function() {
	if (this.parent && this.parent.getBox) {
		return this.parent.getBox();
	} else {
		return {
			top : 0,
			left : 0,
			width : tactile.Device.screen.getWidth(),
			height : tactile.Device.screen.getHeight()
		};
	}
};
tactile.foundation.UIContainer.prototype.getParentInnerBox = function() {
	if (this.parent && this.parent.getInnerBox) {
		return this.parent.getInnerBox();
	} else {
		return {
			top : 0,
			left : 0,
			width : tactile.Device.screen.getWidth(),
			height : tactile.Device.screen.getHeight()
		};
	}
};
tactile.foundation.UIContainer.prototype.getInnerBox = function() {
	var b = {
		left : tactile.c.E.getStyleValue(this.elem, "border-left-width"),
		right : tactile.c.E.getStyleValue(this.elem, "border-right-width"),
		top : tactile.c.E.getStyleValue(this.elem, "border-top-width"),
		bottom : tactile.c.E.getStyleValue(this.elem, "border-bottom-width")
	};
	var d = {
		left : tactile.c.E.getStyleValue(this.elem, "margin-left"),
		right : tactile.c.E.getStyleValue(this.elem, "margin-right"),
		top : tactile.c.E.getStyleValue(this.elem, "margin-top"),
		bottom : tactile.c.E.getStyleValue(this.elem, "margin-bottom")
	};
	var e = {
		left : tactile.c.E.getStyleValue(this.elem, "padding-left"),
		right : tactile.c.E.getStyleValue(this.elem, "padding-right"),
		top : tactile.c.E.getStyleValue(this.elem, "padding-top"),
		bottom : tactile.c.E.getStyleValue(this.elem, "padding-bottom")
	};
	if (tactile.foundation.LayoutManager.loaded) {
		this.getInnerBox = function() {
			var g = this.getOuterBox();
			var f = {
				width : (g.width - b.left - b.right - d.left - d.right - e.left - e.right),
				height : (g.height - b.top - b.bottom - d.left - d.bottom
						- e.left - e.right),
				left : (e.left),
				top : (e.top)
			};
			return f;
		};
		return this.getInnerBox();
	}
	var c = this.getOuterBox();
	var a = {
		width : (c.width - b.left - b.right - d.left - d.right - e.left - e.right),
		height : (c.height - b.top - b.bottom - d.left - d.bottom - e.left - e.right),
		left : (e.left),
		top : (e.top)
	};
	return a;
};
tactile.foundation.UIContainer.prototype.getOuterBox = function() {
	var c = {
		left : tactile.c.E.getStyleValue(this.elem, "margin-left"),
		right : tactile.c.E.getStyleValue(this.elem, "margin-right"),
		top : tactile.c.E.getStyleValue(this.elem, "margin-top"),
		bottom : tactile.c.E.getStyleValue(this.elem, "margin-bottom")
	};
	if (tactile.foundation.LayoutManager.loaded) {
		this.getOuterBox = function() {
			var e = this.getBox();
			var d = {
				width : (e.width + c.left + c.right),
				height : (e.height + c.top + c.bottom),
				left : (e.left),
				top : (e.top)
			};
			return d;
		};
		return this.getOuterBox();
	}
	var b = this.getBox();
	var a = {
		width : (b.width + c.left + c.right),
		height : (b.height + c.top + c.bottom),
		left : (b.left),
		top : (b.top)
	};
	return a;
};
tactile.foundation.UIContainer.prototype.getBoxOffset = function() {
	var e = {
		left : tactile.c.E.getStyleValue(this.elem, "margin-left"),
		right : tactile.c.E.getStyleValue(this.elem, "margin-right"),
		top : tactile.c.E.getStyleValue(this.elem, "margin-top"),
		bottom : tactile.c.E.getStyleValue(this.elem, "margin-bottom")
	};
	var c = {
		left : tactile.c.E.getStyleValue(this.elem, "border-left-width"),
		right : tactile.c.E.getStyleValue(this.elem, "border-right-width"),
		top : tactile.c.E.getStyleValue(this.elem, "border-top-width"),
		bottom : tactile.c.E.getStyleValue(this.elem, "border-bottom-width")
	};
	var f = {
		left : tactile.c.E.getStyleValue(this.elem, "padding-left"),
		right : tactile.c.E.getStyleValue(this.elem, "padding-right"),
		top : tactile.c.E.getStyleValue(this.elem, "padding-top"),
		bottom : tactile.c.E.getStyleValue(this.elem, "padding-bottom")
	};
	if (tactile.foundation.LayoutManager.loaded) {
		this.getBoxOffset = function() {
			var k = 0;
			var l = 0;
			if (this.parent) {
				var i = this.parent.getTopLefOffset();
				k = i.top;
				l = i.left;
			}
			var h = {
				width : e.left + e.right + c.left + c.right + f.left + f.right,
				height : e.top + e.bottom + c.top + c.bottom + f.top + f.bottom,
				top : k,
				left : l
			};
			return h;
		};
		return this.getBoxOffset();
	}
	var d = 0;
	var g = 0;
	if (this.parent) {
		var b = this.parent.getTopLefOffset();
		d = b.top;
		g = b.left;
	}
	var a = {
		width : e.left + e.right + c.left + c.right + f.left + f.right,
		height : e.top + e.bottom + c.top + c.bottom + f.top + f.bottom,
		top : d,
		left : g
	};
	return a;
};
tactile.foundation.UIContainer.prototype.getTopLefOffset = function() {
	var a = tactile.c.E.getStyleValue(this.elem, "padding-top");
	var b = tactile.c.E.getStyleValue(this.elem, "padding-left");
	if (tactile.foundation.LayoutManager.loaded) {
		this.getTopLefOffset = function() {
			return {
				top : a,
				left : b
			};
		};
		return this.getTopLefOffset();
	}
	return {
		top : a,
		left : b
	};
};
tactile.foundation.UIContainer.prototype.resize = function(a) {
	if (a) {
		if (a.top !== undefined && !isNaN(a.top)) {
			this.elem.style.top = a.top + tactile.Enum.Unit.px;
		} else {
			this.elem.style.top = "";
		}
		if (a.left !== undefined && !isNaN(a.left)) {
			this.elem.style.left = a.left + tactile.Enum.Unit.px;
		} else {
			this.elem.style.left = "";
		}
		if (a.width !== undefined && !isNaN(a.width)) {
			this.elem.style.width = a.width + tactile.Enum.Unit.px;
		} else {
			this.elem.style.width = "";
		}
		if (a.height !== undefined && !isNaN(a.height)) {
			this.elem.style.height = a.height + tactile.Enum.Unit.px;
		} else {
			this.elem.style.height = "";
		}
		tactile.logger.info("resize: " + this.id + " " + JSON.stringify(a));
	}
};
tactile.foundation.UIContainer.prototype.update = function(e) {
	var f = this.getBoxOffset();
	if (e) {
		if (!this.effect
				|| (this.effect && this.state && (this.state == "initialized"
						|| this.state == "showed" || this.state == "hidden"))) {
			if (e.top !== undefined && !isNaN(e.top)) {
				var c = this.validateNumber(this.configTop, e);
				if (c !== null) {
					this.elem.style.top = (c + f.top) + tactile.Enum.Unit.px;
				}
			}
			if (e.left !== undefined && !isNaN(e.left)) {
				var b = this.validateNumber(this.configLeft, e);
				if (b !== null) {
					this.elem.style.left = (b + f.left) + tactile.Enum.Unit.px;
				}
			}
			if (e.width !== undefined && !isNaN(e.width)) {
				var a = this.validateNumber(this.configWidth, e);
				if (a !== null) {
					this.elem.style.width = (a - f.width)
							+ tactile.Enum.Unit.px;
				}
			}
			if (e.height !== undefined && !isNaN(e.height)) {
				var d = this.validateNumber(this.configHeight, e);
				if (d !== null) {
					this.elem.style.height = (d - f.height)
							+ tactile.Enum.Unit.px;
				}
			}
		}
		tactile.logger.info("update: " + this.id + " " + JSON.stringify(e));
	}
	if (this.configVisible !== undefined) {
		if (this.validateVisible()) {
			this.elem.style.display = this.elem.displayStyle;
		} else {
			this.elem.style.display = tactile.Enum.Display.none;
		}
	}
};
tactile.foundation.UIContainer.prototype.append = function(a) {
	if (a instanceof tactile.foundation.UIContainer) {
		a.parent = this;
		tactile.foundation.UIComponent.prototype.append.call(this, a);
		a.update(a.getParentInnerBox());
		tactile.logger.info("tactile.foundation.UIContainer.append " + this.id
				+ ", element: " + a.id);
	} else {
		tactile.logger
				.error(this.id
						+ "Type mismatch: tactile.foundation.UIContainer.append  expects argument of type tactile.foundation.UIContainer!");
	}
};
tactile.foundation.UIContainer.prototype.toString = function() {
	return "Object - tactile.foundation.UIContainer";
};
tactile.foundation.LayoutManager = {
	layouts : new Array(),
	loaded : false,
	init : function() {
		var a = tactile.foundation.LayoutManager;
		if (a.layouts.length > 0) {
			if (tactile.Device.isTouch) {
				var b = Math.max(window.innerHeight, window.innerWidth) + 200;
				tactile.c.U.setBodyStyle("height", b + tactile.Enum.Unit.px);
			}
			tactile.EventManager.addOnloadListener(function() {
				a.loaded = true;
				a.updateLayout();
				window.setTimeout(function() {
					a.updateLayout();
				}, 1000);
			});
			tactile.EventManager.addResizeListener(a.updateLayout, this);
			tactile.events.TouchEventManager.addListener(document, "touchmove",
					function(c) {
						c.browserEvent.preventDefault();
						c.browserEvent.stopPropagation();
					});
			a.updateLayout();
			if (tactile.Device.platform == "android") {
				window.setTimeout(function() {
					document.addEventListener("scroll", function() {
						setTimeout(function() {
							tactile.foundation.LayoutManager.updateLayout();
						}, 500);
					}, 2000);
				});
			}
		}
	},
	updateLayout : function() {
		var b = tactile.foundation.LayoutManager;
		window.scrollTo(0, 1);
		for ( var a = 0; a < b.layouts.length; a++) {
			b.layouts[a].update(b.layouts[a].getParentInnerBox());
		}
	},
	addLayout : function(b) {
		var a = tactile.foundation.LayoutManager;
		if (b instanceof tactile.Layout) {
			if (!a.layouts.contains(b)) {
				a.layouts.push(b);
			}
		} else {
			throw "Error - type mismatch: tactile.foundation.LayoutManager.addLayout expects argument of type Layout!";
		}
	}
};
tactile.ContentLoader = function(a) {
	a = a || {};
	this.onstart = new tactile.foundation.Observer();
	this.onsuccess = new tactile.foundation.Observer();
	this.onerror = new tactile.foundation.Observer();
	this.responseUID = tactile.c.U.getUID();
	var b = "";
	this.setUrl = function(c) {
		if (c) {
			if (c.indexOf("http") == 0) {
				throw "Error - "
						+ this
						+ ": Absolute URLs are not allowed for the contentLoader";
			} else {
				b = c;
			}
		}
		return b;
	};
	this.scriptInitialized = false;
	this.loadedComponents = [];
	this.customErrors = a.errors || {};
	this.url = this.setUrl(a.url);
	this.method = a.method || "get";
	this.parameters = a.params || "";
	this.fragmentId = a.fragment;
	this.xhr = null;
};
tactile.ContentLoader.prototype.removeResponseContainer = function() {
	var a = document.getElementById(this.responseUID);
	if (a) {
		a.parentNode.removeChild(a);
	}
};
tactile.ContentLoader.prototype.load = function(b) {
	var d;
	b = b || {};
	this.xhr = tactile.c.A.getXHRObject();
	this.url = this.setUrl(b.url);
	this.method = b.method || this.method;
	this.parameters = b.params || this.parameters;
	if (b.fragment) {
		this.fragmentId = b.fragment;
	}
	if (this.fragmentId) {
		if (this.parameters.length > 0) {
			this.parameters += "&";
		}
		this.parameters += "nbbiscuitid=" + this.fragmentId;
	}
	this.parameters = (this.parameters.length > 0) ? (this.parameters + "&")
			: this.parameters;
	if (tactile.Device.browser.canCookie) {
		this.parameters += "emvcc=1";
	} else {
		this.parameters += "emvcc=0";
	}
	this.parameters += "&disablejsd=true";
	if (this.url.indexOf("?") >= 0) {
		var c = this.url.split("?");
		if (c.length > 0) {
			this.url = c[0] + tactile.c.A.getSessionID() + "?";
			if (c[1]) {
				this.url = this.url + c[1];
			}
		}
		this.url = this.url + "&";
	} else {
		this.url = this.url + tactile.c.A.getSessionID() + "?";
	}
	if (this.method.toUpperCase() == "GET") {
		if (this.url.indexOf("?") >= 0) {
			this.url = this.url + "&";
		} else {
			if (this.parameters.length > 0) {
				this.url = this.url + "?";
			}
		}
		this.url += this.parameters;
	}
	var a = this;
	this.xhr.onreadystatechange = function() {
		try {
			if (a.xhr.readyState == 2) {
				var g = a.getStatus();
				a.onstart.fire({
					status : g.status,
					message : g.message,
					url : a.url,
					loader : a
				});
			} else {
				if (a.xhr.readyState == 4) {
					if (a.xhr.status == 200) {
						a.scriptInitialized = false;
						a.loadedComponents = [];
						var g = a.getStatus();
						a.onsuccess.fire({
							status : g.status,
							message : g.message,
							url : a.url,
							loader : a
						});
					} else {
						var g = a.getStatus();
						a.onerror.fire({
							status : g.status,
							message : g.message,
							url : a.url,
							loader : a
						});
					}
				}
			}
		} catch (h) {
			a.onerror.fire({
				status : h.number,
				message : h.message,
				url : a.url,
				loader : a
			});
		}
	};
	try {
		d = tactile.c.A.getRootPath() + this.url;
		this.xhr.open(this.method, d, true);
	} catch (f) {
		a.onerror.fire({
			status : f.number,
			message : f.message,
			url : a.url,
			loader : a
		});
	}
	this.xhr.setRequestHeader("Cache-Control", "no-transform");
	this.xhr.setRequestHeader("Content-type",
			"application/x-www-form-urlencoded");
	if (this.method.toUpperCase() == "GET") {
		this.xhr.send(null);
	} else {
		this.xhr.send(this.parameters);
	}
};
tactile.ContentLoader.prototype.getComponent = function(d) {
	var b = null;
	var a = this.getComponents();
	for ( var c = 0; c < a.length; c++) {
		if (a[c].id == d) {
			b = a[c];
		}
	}
	return b;
};
tactile.ContentLoader.prototype.getComponents = function() {
	var filter = [];
	if (arguments && arguments.length > 0) {
		for ( var j = 0; j < arguments.length; j++) {
			filter.push(arguments[j].toString());
		}
	} else {
		filter = [ tactile.View.toString(), tactile.MultiView.toString(),
				tactile.FlexView.toString(), tactile.Layout.toString(),
				tactile.FlexItem.toString() ];
	}
	var responseContainer, scripts;
	if (!this.scriptInitialized && this.xhr !== null) {
		this.removeResponseContainer();
		responseContainer = document.createElement("div");
		responseContainer.setAttribute("id", this.responseUID);
		responseContainer.style.display = "none";
		responseContainer.appendChild(this.xhr.getResponseDom());
		document.body.appendChild(responseContainer);
		if (responseContainer) {
			scripts = responseContainer.getElementsByTagName("script");
			for ( var i = 0; i < scripts.length; i++) {
				var script = scripts[i].innerHTML;
				var found = false;
				filter.forEach(function(el) {
					if (script.indexOf(el) > -1) {
						found = true;
					}
				});
				if (found) {
					var compid = scripts[i].parentNode.id;
					if (compid.indexOf("nbautoid") > -1
							&& tactile.page.isComponent(compid)) {
						compid = tactile.foundation.UIComponent.getNewId();
						script = script.replace(scripts[i].parentNode.id,
								compid);
						scripts[i].parentNode.id = compid;
					}
					if (!tactile.page.isComponent(scripts[i].parentNode.id)) {
						try {
							script = script.replace(/\n/gim, "");
							script = script.replace(/<!--/gim, "");
							script = script.replace(/-->/gim, "");
							script = script
									.replace(
											/tactile.\page\.init\s*?\(function\s*?\(\)\s*?\{(.*?)\}\);$/gim,
											"$1");
							var newcomp = eval(script);
							this.loadedComponents.push(newcomp);
						} catch (ex) {
							tactile.logger
									.error("ContentLoader.getComponents: initialization of remote component "
											+ scripts[i].parentNode.id
											+ " has thrown an exception: "
											+ ex.message);
						}
					} else {
						tactile.logger
								.warn("ContentLoader.getComponents: component "
										+ scripts[i].parentNode.id
										+ " allready exists!");
					}
				}
			}
			this.scriptInitialized = true;
		}
	}
	return this.loadedComponents;
};
tactile.ContentLoader.prototype.setCustomErrors = function(a) {
	this.customErrors = a;
};
tactile.ContentLoader.prototype.getStatus = function(b) {
	var a = b || this.xhr.status;
	return (this.customErrors[this.xhr.status]) ? {
		status : this.xhr.status,
		message : this.customErrors[this.xhr.status]
	} : {
		status : this.xhr.status,
		message : this.xhr.statusText
	};
};
tactile.ContentLoader.prototype.stop = function() {
	if (this.xhr !== null) {
		this.xhr.abort();
		this.onerror.fire({
			status : "0",
			message : "Request stopped",
			url : this.url,
			loader : this
		});
	}
};
tactile.ContentLoader.prototype.getResponseText = function() {
	if (this.xhr !== null) {
		return this.xhr.responseText;
	} else {
		return null;
	}
};
tactile.ContentLoader.prototype.getResponseXML = function() {
	if (this.xhr !== null) {
		return this.xhr.responseXML;
	} else {
		return null;
	}
};
tactile.Layout = function(c, a) {
	a = a || {};
	if (a.position && tactile.Enum.contains(tactile.Enum.Position, a.position)) {
		a.position = tactile.Enum.getValue(tactile.Enum.Position, a.position);
	} else {
		a.position = tactile.Enum.Position.absolute;
	}
	if (a.overflow && tactile.Enum.contains(tactile.Enum.Overflow, a.overflow)) {
		a.overflow = tactile.Enum.getValue(tactile.Enum.Overflow, a.overflow);
	} else {
		a.overflow = tactile.Enum.Overflow.hidden;
	}
	var b = (typeof c == "string") ? c : c.id;
	if (!a.width) {
		throw "Error: No width specified for " + b;
	}
	if (!a.height) {
		throw "Error: No height specified for " + b;
	}
	if (a.parent) {
		this.parent = a.parent;
	} else {
		tactile.foundation.LayoutManager.addLayout(this);
	}
	tactile.Layout.prototype.init.call(this, c, a);
	this.onresize = new tactile.foundation.Observer();
	this.onstatechange = new tactile.foundation.Observer();
	this.aftershow = new tactile.foundation.Observer();
	this.beforeshow = new tactile.foundation.Observer();
	this.afterhide = new tactile.foundation.Observer();
	this.beforehide = new tactile.foundation.Observer();
	if (a.parent && a.parent.getBox) {
		a.parent.onresize.subscribe(this.update, this);
	}
	this.aftershow.subscribe(function(d) {
		this.update(this.getParentInnerBox());
	}, this);
	this.state = "initialized";
	this.beforehide.subscribe(function(d) {
		this.state = "hiding";
	}, this);
	this.afterhide.subscribe(function(d) {
		this.state = "hidden";
	}, this);
	this.afterhide.subscribe(function(d) {
		this.onstatechange.fire({
			sourceId : d.targetId
		});
	}, this);
	this.beforeshow.subscribe(function(d) {
		this.state = "showing";
	}, this);
	this.aftershow.subscribe(function(d) {
		this.state = "showed";
	}, this);
	this.aftershow.subscribe(function(d) {
		this.onstatechange.fire({
			sourceId : d.targetId
		});
	}, this);
};
tactile.Layout.cast = function(a) {
	return (a instanceof tactile.Layout) ? a : null;
};
tactile.Layout.prototype = new tactile.foundation.UIContainer();
tactile.Layout.prototype.update = function(b) {
	tactile.foundation.UIContainer.prototype.update.call(this, b);
	var a = this.getInnerBox();
	this.onresize.fire(a);
};
tactile.Layout.prototype.updateState = function(a) {
	this.onstatechange.fire(a);
};
tactile.Layout.prototype.append = function(a) {
	if (a instanceof tactile.Layout || a instanceof tactile.View
			|| a instanceof tactile.MultiView || a instanceof tactile.FlexView) {
		if (a.parent) {
			a.parent.onresize.unsubscribe(a.update);
		}
		tactile.foundation.UIContainer.prototype.append.call(this, a);
		a.parent.onresize.subscribe(a.update, a);
	} else {
		throw "Error - type mismatch: tactile.Layout.append expects argument of type tactile.View, tactile.FlexView or tactile.MultiView!";
	}
};
tactile.Layout.prototype.toString = function() {
	return "Object - tactile.Layout";
};
tactile.Layout.toString = function() {
	return "tactile.Layout";
};
tactile.View = function(b, a) {
	a = a || {};
	if (a.effect) {
		if (a.effect.type == tactile.Enum.Effects.expand
				|| a.effect.type == tactile.Enum.Effects.slide) {
			if (!a.position) {
				a.position = tactile.Enum.Position.absolute;
			}
			if (a.effect.type == tactile.Enum.Effects.expand) {
				if (!a.overflow) {
					a.overflow = tactile.Enum.Overflow.hidden;
				}
			}
		}
	}
	if (a.parent) {
		if (a.parent instanceof tactile.foundation.UIContainer === true) {
			this.parent = a.parent;
		} else {
			tactile.logger.error("Error - type mismatch: View " + this.id
					+ " expects parent of type UIContainer!");
		}
	}
	tactile.View.prototype.init.call(this, b, a);
	this.onresize = new tactile.foundation.Observer();
	this.onstatechange = new tactile.foundation.Observer();
	this.aftershow = new tactile.foundation.Observer();
	this.beforeshow = new tactile.foundation.Observer();
	this.afterhide = new tactile.foundation.Observer();
	this.beforehide = new tactile.foundation.Observer();
	if (this.parent && this.parent instanceof tactile.MultiView === true) {
		if (!this.parent.views.contains(this)) {
			this.parent.addView(this);
		}
	}
	if (this.parent && this.parent.getBox) {
		this.parent.onresize.subscribe(this.update, this);
	}
	this.scroller = undefined;
	if (a.scroll) {
		var c = {
			scroll : a.scroll
		};
		if (a.scrollbar) {
			c.scrollbar = a.scrollbar;
		}
		this.scroller = new tactile.foundation.Scroller(this, c);
		tactile.logger.info(this.toString() + ", scroller: "
				+ this.scroller.toString());
	}
	this.aftershow.subscribe(function(d) {
		this.update(this.getParentInnerBox());
	}, this);
	this.state = "initialized";
	this.beforehide.subscribe(function(d) {
		this.state = "hiding";
	}, this);
	this.afterhide.subscribe(function(d) {
		this.state = "hidden";
	}, this);
	this.afterhide.subscribe(function(d) {
		this.onstatechange.fire({
			sourceId : d.targetId
		});
	}, this);
	this.beforeshow.subscribe(function(d) {
		this.state = "showing";
	}, this);
	this.aftershow.subscribe(function(d) {
		this.state = "showed";
	}, this);
	this.aftershow.subscribe(function(d) {
		this.onstatechange.fire({
			sourceId : d.targetId
		});
	}, this);
};
tactile.View.cast = function(a) {
	return (a instanceof tactile.View) ? a : null;
};
tactile.View.prototype = new tactile.foundation.UIContainer();
tactile.View.prototype.update = function(b) {
	tactile.foundation.UIContainer.prototype.update.call(this, b);
	var a = this.getInnerBox();
	this.onresize.fire(a);
};
tactile.View.prototype.updateState = function(a) {
	if ((this.state === "hiding" || this.state === "showing") && this.effect
			&& this.effect.transitionEnd) {
		this.effect.transitionEnd({});
	}
	this.onstatechange.fire(a);
};
tactile.View.prototype.append = function(a) {
	if (a instanceof tactile.View || a instanceof tactile.MultiView
			|| a instanceof tactile.FlexView) {
		if (a.parent) {
			a.parent.onresize.unsubscribe(a.update);
		}
		tactile.foundation.UIContainer.prototype.append.call(this, a);
		a.parent.onresize.subscribe(a.update, a);
	} else {
		throw "Error - type mismatch: tactile.View.append expects argument of type tactile.View, tactile.FlexView or tactile.MultiView!";
	}
};
tactile.View.prototype.toString = function() {
	return "Object - tactile.View";
};
tactile.View.toString = function() {
	return "tactile.View";
};
tactile.MultiView = function(d, b) {
	b = b || {};
	b.width = b.width || function(e) {
		return e.width;
	};
	b.height = b.height || function(e) {
		return e.height;
	};
	if (b.parent) {
		this.parent = b.parent;
	}
	tactile.MultiView.prototype.init.call(this, d, b);
	this.onresize = new tactile.foundation.Observer();
	this.onstatechange = new tactile.foundation.Observer();
	this.aftershow = new tactile.foundation.Observer();
	this.beforeshow = new tactile.foundation.Observer();
	this.afterhide = new tactile.foundation.Observer();
	this.beforehide = new tactile.foundation.Observer();
	this.onswitch = new tactile.foundation.Observer();
	if (this.parent && this.parent.getBox) {
		this.parent.onresize.subscribe(this.update, this);
	}
	this.views = new Array();
	this.selectedIndex = 0;
	if (b.selectedIndex && !isNaN(b.selectedIndex)) {
		this.selectedIndex = b.selectedIndex;
	}
	if (b.swipe) {
		this.swipe = b.swipe;
		var a = this;
		this.elem.me = a;
		tactile.events.TouchEventManager.addListener(this.elem, "swipe",
				a.onSwipe);
	}
	this.aftershow.subscribe(function(f) {
		this.update(this.getParentInnerBox());
	}, this);
	this.state = "initialized";
	this.beforehide.subscribe(function(f) {
		this.state = "hiding";
	}, this);
	this.afterhide.subscribe(function(f) {
		this.state = "hidden";
	}, this);
	this.afterhide.subscribe(function(f) {
		this.onstatechange.fire({
			sourceId : f.targetId
		});
	}, this);
	this.beforeshow.subscribe(function(f) {
		this.state = "showing";
	}, this);
	this.aftershow.subscribe(function(f) {
		this.state = "showed";
	}, this);
	this.aftershow.subscribe(function(f) {
		this.onstatechange.fire({
			sourceId : f.targetId
		});
	}, this);
	var c = 0;
	this.setSwitching = function(e) {
		if (e) {
			c += 2;
		} else {
			c -= 1;
		}
	};
	this.isSwitching = function() {
		return (this.state === "showing") || (this.state === "hiding");
	};
};
tactile.MultiView.cast = function(a) {
	return (a instanceof tactile.MultiView) ? a : null;
};
tactile.MultiView.prototype = new tactile.foundation.UIContainer();
tactile.MultiView.prototype.addView = function(a) {
	if (a instanceof tactile.View) {
		if (!this.views.contains(a)) {
			if (this.selectedIndex != this.views.length) {
				a.elem.style.display = tactile.Enum.Display.none;
			}
			a.afterhide.subscribe(function() {
				this.setSwitching(false);
			}, this);
			a.aftershow.subscribe(function() {
				this.setSwitching(false);
			}, this);
			if (!a.parent) {
				a.parent = this;
			}
			a.getVisibility = undefined;
			this.views.push(a);
		}
		return a;
	} else {
		throw "Error - type mismatch: tactile.MultiView.addView expects argument of type tactile.View!";
	}
};
tactile.MultiView.prototype.addViewById = function(b, a) {
	a = a || {};
	a.parent = a.parent || this;
	return this.addView(new tactile.View(b, a));
};
tactile.MultiView.prototype.addViewsByClassName = function(d, b) {
	b = b || {};
	b.parent = b.parent || this;
	var a = document.getElementsByClassName(d, this.elem);
	for ( var c = 0; c < a.length; c++) {
		this.addView(new tactile.View(a[c], b));
	}
};
tactile.MultiView.prototype.append = function(a) {
	if (a instanceof tactile.View) {
		if (a.parent) {
			a.parent.onresize.unsubscribe(a.update);
		}
		tactile.foundation.UIContainer.prototype.append.call(this, a);
		a.parent.onresize.subscribe(a.update, a);
		this.addView(a);
	} else {
		throw "Error - type mismatch: tactile.MultiView.appendView expects argument of type tactile.View!";
	}
};
tactile.MultiView.prototype.remove = function(b) {
	if (b instanceof tactile.View) {
		if (this.views.contains(b) && this.views.length > 1) {
			var a = this.views.indexOf(b, 0);
			if (a != -1) {
				if (this.selectedIndex == a) {
					var c = this;
					this.showNext();
					var d = 10;
					if (b.effect) {
						d = b.effect.duration;
					}
					if (b.effect) {
						b.afterhide.subscribe(function(f) {
							tactile.foundation.UIComponent.prototype.remove
									.call(c, b);
							c.views.splice(a, 1);
							if (c.selectedIndex > 0) {
								c.selectedIndex -= 1;
							}
						}, this);
					} else {
						tactile.foundation.UIComponent.prototype.remove.call(c,
								b);
						c.views.splice(a, 1);
						if (c.selectedIndex > 0) {
							c.selectedIndex -= 1;
						}
					}
				} else {
					tactile.foundation.UIComponent.prototype.remove.call(this,
							b);
					this.views.splice(a, 1);
					if (this.selectedIndex > a) {
						this.selectedIndex -= 1;
					}
				}
			}
		}
	}
};
tactile.MultiView.prototype.showView = function(d, c) {
	if (d < 0 || d >= this.views.length) {
		tactile.logger.error(this.id + ".showView(" + d + ", " + c
				+ "): Index out of bounds (0 - " + this.views.length + ")");
		return;
	}
	if (this.isSwitching()) {
		return;
	}
	var g = null;
	if (!isNaN(d) && d != this.selectedIndex) {
		if (d >= this.views.length) {
			return;
		}
		g = this.selectedIndex;
		this.selectedIndex = d;
		this.setSwitching(true);
		this.beforehide.fire({
			index : g
		});
		this.views[g].hide(c);
		var b = this;
		if (this.views[g].effect) {
			this.views[g].afterhide.subscribe(function(i) {
				b.afterhide.fire({
					index : g
				});
			}, this);
		} else {
			b.afterhide.fire({
				index : g
			});
		}
		this.beforeshow.fire({
			index : d
		});
		this.views[this.selectedIndex].show(c);
		if (this.views[this.selectedIndex].effect) {
			this.views[this.selectedIndex].aftershow.subscribe(function(i) {
				b.aftershow.fire({
					index : b.selectedIndex
				});
			}, this);
		} else {
			b.aftershow.fire({
				index : b.selectedIndex
			});
		}
	} else {
		var a = null;
		for ( var f = 0; f < this.views.length; f++) {
			if (this.views[f].id === d) {
				a = f;
				break;
			}
		}
		if (a !== null && a != this.selectedIndex) {
			g = this.selectedIndex;
			this.selectedIndex = a;
			this.setSwitching(true);
			this.beforehide.fire({
				index : g
			});
			this.views[g].hide(c);
			var b = this;
			if (this.views[g].effect) {
				this.views[g].afterhide.subscribe(function(i) {
					b.afterhide.fire({
						index : g
					});
				}, this);
			} else {
				b.afterhide.fire({
					index : g
				});
			}
			this.beforeshow.fire({
				index : d
			});
			this.views[this.selectedIndex].show(c);
			if (this.views[this.selectedIndex].effect) {
				this.views[this.selectedIndex].aftershow.subscribe(function(i) {
					b.aftershow.fire({
						index : b.selectedIndex
					});
				}, this);
			} else {
				b.aftershow.fire({
					index : b.selectedIndex
				});
			}
		}
	}
	if (g !== null) {
		var h = {
			target : this.id,
			previousIndex : g,
			selectedIndex : this.selectedIndex,
			previousId : this.views[g].id,
			selectedId : this.views[this.selectedIndex].id
		};
		this.onswitch.fire(h);
		var e = this.getInnerBox();
		this.onresize.fire(e);
	}
};
tactile.MultiView.prototype.showNext = function(a) {
	if (this.selectedIndex + 1 >= this.views.length) {
		this.showFirst(a);
	} else {
		this.showView(this.selectedIndex + 1, a);
	}
};
tactile.MultiView.prototype.showPrev = function(a) {
	if (this.selectedIndex - 1 < 0) {
		this.showLast(a);
	} else {
		this.showView(this.selectedIndex - 1, a);
	}
};
tactile.MultiView.prototype.showFirst = function(a) {
	this.showView(0, a);
};
tactile.MultiView.prototype.showLast = function(a) {
	this.showView(this.views.length - 1, a);
};
tactile.MultiView.prototype.update = function(b) {
	if (this.selectedIndex < 0 || isNaN(this.selectedIndex)) {
		this.selectedIndex = 0;
	} else {
		if (this.selectedIndex > this.views.length - 1) {
			this.selectedIndex = (this.views.length > 0) ? this.views.length - 1
					: 0;
		}
	}
	tactile.foundation.UIContainer.prototype.update.call(this, b);
	var a = this.getInnerBox();
	this.onresize.fire(a);
};
tactile.MultiView.prototype.updateState = function(a) {
	this.onstatechange.fire(a);
};
tactile.MultiView.prototype.onSwipe = function(d) {
	var a = this.me;
	var c = d.direction.toUpperCase();
	var b = a.validateSwipeDirection();
	if (c == "LEFT") {
		a.showNext({
			slideto : tactile.Enum.Direction.west,
			slidefrom : tactile.Enum.Direction.east
		});
	} else {
		if (c == "RIGHT") {
			a.showPrev({
				slideto : tactile.Enum.Direction.east,
				slidefrom : tactile.Enum.Direction.west
			});
		}
	}
};
tactile.MultiView.prototype.validateSwipeDirection = function() {
	var b = tactile.effects.Direction.horizontal;
	if (this.swipe) {
		if (typeof this.swipe === "function") {
			try {
				b = this.swipe();
			} catch (a) {
				b = tactile.effects.Direction.horizontal;
				tactile.logger.error(this.id
						+ ".validateSwipeDirection() has thrown an exception: "
						+ a);
			}
		} else {
			if (typeof this.swipe === "string") {
				if (tactile.Enum
						.contains(tactile.effects.Direction, this.swipe)) {
					b = this.swipe;
				} else {
					b = tactile.effects.Direction.horizontal;
					tactile.logger
							.error(this.id
									+ ".validateSwipeDirection - tactile.effects.Direction doesn't contains "
									+ this.swipe);
				}
			}
		}
	}
	return b;
};
tactile.MultiView.prototype.toString = function() {
	return "Object - tactile.MultiView";
};
tactile.MultiView.toString = function() {
	return "tactile.MultiView";
};
tactile.FlexView = function(b, a) {
	a = a || {};
	if (a.parent) {
		if (a.parent instanceof tactile.foundation.UIContainer === true) {
			this.parent = a.parent;
		} else {
			tactile.logger.error("Error - type mismatch: tactile.Flexview "
					+ this.id + " expects parent of type UIContainer!");
		}
	}
	tactile.FlexView.prototype.init.call(this, b, a);
	this.onresize = new tactile.foundation.Observer();
	this.onstatechange = new tactile.foundation.Observer();
	this.aftershow = new tactile.foundation.Observer();
	this.beforeshow = new tactile.foundation.Observer();
	this.afterhide = new tactile.foundation.Observer();
	this.beforehide = new tactile.foundation.Observer();
	if (this.parent) {
		this.parent.onresize.subscribe(this.update, this);
	}
	this.flexitems = new Array();
	this.scroller = undefined;
	if (a.scroll) {
		var c = {
			scroll : a.scroll
		};
		if (a.scrollbar) {
			c.scrollbar = a.scrollbar;
		}
		this.scroller = new tactile.foundation.Scroller(this, c);
	}
	a.flexitem = a.flexitem || {};
	this.configFlexFlow = undefined;
	this.configFlexDimension = undefined;
	this.configFlexItemGap = undefined;
	this.configFlexItemWidth = undefined;
	this.configFlexItemHeight = undefined;
	this.configFlexItemMinWidth = undefined;
	this.configFlexItemMinHeight = undefined;
	if (a.flexflow) {
		if (typeof a.flexflow === "function") {
			this.configFlexFlow = a.flexflow;
		} else {
			if (tactile.Enum.contains(tactile.Enum.FlexFlow, a.flexflow)) {
				this.configFlexFlow = function() {
					return a.flexflow;
				};
			} else {
				this.configFlexFlow = function() {
					return tactile.Enum.FlexFlow.vertical;
				};
			}
		}
	} else {
		this.configFlexFlow = function() {
			return tactile.Enum.FlexFlow.vertical;
		};
	}
	if (a.flexdimension) {
		if (typeof a.flexdimension === "function") {
			this.configFlexDimension = a.flexdimension;
		} else {
			if (tactile.Enum.contains(tactile.Enum.Dimension, a.flexdimension)) {
				this.configFlexDimension = function() {
					return a.flexdimension;
				};
			}
		}
	}
	if (a.flexitem.gap) {
		if (typeof a.flexitem.gap === "function") {
			this.configFlexItemGap = a.flexitem.gap;
		} else {
			if (!isNaN(a.flexitem.gap)) {
				this.configFlexItemGap = function(d) {
					return a.flexitem.gap;
				};
			}
		}
	} else {
		this.configFlexItemGap = function(d) {
			return 0;
		};
	}
	if (a.flexitem.width) {
		if (typeof a.flexitem.width === "function") {
			this.configFlexItemWidth = a.flexitem.width;
		} else {
			if (!isNaN(a.flexitem.width)) {
				this.configFlexItemWidth = function(d) {
					return a.flexitem.width;
				};
			}
		}
	}
	if (a.flexitem.height) {
		if (typeof a.flexitem.height === "function") {
			this.configFlexItemHeight = a.flexitem.height;
		} else {
			if (!isNaN(a.flexitem.height)) {
				this.configFlexItemHeight = function(d) {
					return a.flexitem.height;
				};
			}
		}
	}
	if (a.flexitem.minwidth) {
		if (typeof a.flexitem.minwidth === "function") {
			this.configFlexItemMinWidth = a.flexitem.minwidth;
		} else {
			if (!isNaN(a.flexitem.minwidth)) {
				this.configFlexItemMinWidth = function(d) {
					return a.flexitem.minwidth;
				};
			}
		}
	}
	if (a.flexitem.minheight) {
		if (typeof a.flexitem.minheight === "function") {
			this.configFlexItemMinHeight = a.flexitem.minheight;
		} else {
			if (!isNaN(a.flexitem.minheight)) {
				this.configFlexItemMinHeight = function(d) {
					return a.flexitem.minheight;
				};
			}
		}
	}
	this.aftershow.subscribe(function(d) {
		this.update(this.getParentInnerBox());
	}, this);
	this.state = "initialized";
	this.beforehide.subscribe(function(d) {
		this.state = "hiding";
	}, this);
	this.afterhide.subscribe(function(d) {
		this.state = "hidden";
	}, this);
	this.afterhide.subscribe(function(d) {
		this.onstatechange.fire({
			sourceId : d.targetId
		});
	}, this);
	this.beforeshow.subscribe(function(d) {
		this.state = "showing";
	}, this);
	this.aftershow.subscribe(function(d) {
		this.state = "showed";
	}, this);
	this.aftershow.subscribe(function(d) {
		this.onstatechange.fire({
			sourceId : d.targetId
		});
	}, this);
};
tactile.FlexView.cast = function(a) {
	return (a instanceof tactile.FlexView) ? a : null;
};
tactile.FlexView.prototype = new tactile.foundation.UIContainer();
tactile.FlexView.prototype.addItem = function(a) {
	if (a instanceof tactile.FlexItem) {
		if (!this.flexitems.contains(a)) {
			this.flexitems.push(a);
		}
		return a;
	} else {
		throw "Error - type mismatch: tactile.FlexView.addItem expects argument of type tactile.FlexItem!";
	}
};
tactile.FlexView.prototype.addItemById = function(b, a) {
	a = a || {};
	a.parent = a.parent || this;
	return this.addItem(new tactile.FlexItem(b, a));
};
tactile.FlexView.prototype.addItemsByClassName = function(d, b) {
	b = b || {};
	b.parent = b.parent || this;
	var a = document.getElementsByClassName(d, this.elem);
	for ( var c = 0; c < a.length; c++) {
		this.addItem(new tactile.FlexItem(a[c], b));
	}
};
tactile.FlexView.prototype.append = function(a) {
	if (a instanceof tactile.FlexItem) {
		tactile.foundation.UIContainer.prototype.append.call(this, a);
		this.addItem(a);
		this.update(this.getParentInnerBox());
	} else {
		throw "Error - type mismatch: tactile.FlexView.appendView expects argument of type tactile.FlexItem!";
	}
};
tactile.FlexView.prototype.remove = function(b) {
	if (b instanceof tactile.FlexItem) {
		tactile.foundation.UIComponent.prototype.remove.call(this, b);
		if (this.flexitems.contains(b)) {
			var a = this.flexitems.indexOf(b, 0);
			if (a != -1) {
				this.flexitems.splice(a, 1);
			}
			this.update(this.getParentInnerBox());
		}
	}
};
tactile.FlexView.prototype.update = function(l) {
	tactile.foundation.UIContainer.prototype.update.call(this, l);
	var b = this.flexitems;
	var o = this.configFlexItemGap(this.getBox());
	var k = o;
	var d = o;
	var c = undefined;
	var p = undefined;
	var g = undefined;
	var n = undefined;
	var a = undefined;
	var m = undefined;
	if (this.configWidth != undefined) {
		a = this.validateNumber(this.configWidth, this.getBox());
	} else {
		a = this.parent.getOuterBox().width - o - o;
	}
	if (this.configHeight != undefined) {
		m = this.validateNumber(this.configHeight, this.getBox());
	} else {
		m = this.parent.getOuterBox().height - o - o;
	}
	if (this.configFlexItemWidth != undefined) {
		g = this.validateNumber(this.configFlexItemWidth, this.getBox());
		if (g >= a) {
			g = g - o - o;
		}
	} else {
		g = a;
	}
	if (this.configFlexItemHeight != undefined) {
		n = this.validateNumber(this.configFlexItemHeight, this.getBox());
		if (n >= m) {
			n = n - o - o;
		}
	} else {
		n = m - o - o;
	}
	if (this.configFlexItemMinWidth != undefined) {
		c = this.validateNumber(this.configFlexItemMinWidth, this.getBox());
	}
	if (this.configFlexItemMinHeight != undefined) {
		p = this.validateNumber(this.configFlexItemMinHeight, this.getBox());
	}
	if (n != undefined && p != undefined && n <= p) {
		n = p;
	}
	if (g != undefined && c != undefined && g <= c) {
		g = c;
	}
	for ( var h = 0; h < b.length; h++) {
		b[h].resize({});
		if (this.validFlexFlow() == tactile.Enum.FlexFlow.vertical) {
			if (this.configFlexItemHeight === undefined) {
				if ((p !== undefined) && (p >= b[h].getOuterBox().height)) {
					n = p;
				} else {
					n = b[h].getOuterBox().height;
				}
			}
		} else {
			if (this.configFlexItemWidth === undefined) {
				if ((c !== undefined) && (c >= b[h].getInnerBox().width)) {
					g = c;
				} else {
					g = b[h].getOuterBox().width;
				}
			}
		}
		b[h].resize({
			width : g,
			height : n,
			left : d,
			top : k
		});
		b[h].onresize.fire(b[h].getInnerBox());
		if (this.configFlexFlow() == tactile.Enum.FlexFlow.vertical) {
			k += b[h].getOuterBox().height + o;
		} else {
			d += b[h].getOuterBox().width + o;
		}
	}
	var q;
	var f = this.getBoxOffset();
	if (this.validFlexFlow() == tactile.Enum.FlexFlow.vertical) {
		q = {
			width : ((this.configWidth != undefined) ? (this.configWidth(l) - f.width)
					: l.width),
			height : k,
			left : ((this.configLeft != undefined) ? (this.configLeft(l) - f.left)
					: undefined),
			top : ((this.configTop != undefined) ? (this.configTop(l) - f.width)
					: undefined)
		};
	} else {
		q = {
			width : d,
			height : ((this.configHeight != undefined) ? (this.configHeight(l) - f.height)
					: l.height),
			left : ((this.configLeft != undefined) ? (this.configLeft(l) - f.left)
					: undefined),
			top : ((this.configTop != undefined) ? (this.configTop(l) - f.width)
					: undefined)
		};
	}
	this.resize(q);
	var e = this.getInnerBox();
	this.onresize.fire(e);
};
tactile.FlexView.prototype.validFlexFlow = function() {
	var a = tactile.Enum.FlexFlow.vertical;
	if (this.configFlexFlow) {
		try {
			a = this.configFlexFlow();
		} catch (b) {
			tactile.logger.error(this.id
					+ ".validFlexFlow() has thrown an exception: " + b);
			a = tactile.Enum.FlexFlow.vertical;
		}
		if (tactile.Enum.contains(tactile.Enum.FlexFlow, a)) {
			return a;
		} else {
			tactile.logger
					.error(this.id
							+ ".validFlexFlow - tactile.Enum.FlexFlow doesn't contains "
							+ a);
			a = tactile.Enum.FlexFlow.vertical;
		}
	}
	return a;
};
tactile.FlexView.prototype.validFlexDimension = function() {
	var a = undefined;
	if (this.configFlexDimension) {
		try {
			a = this.configFlexDimension();
		} catch (b) {
			tactile.logger.error(this.id
					+ ".validFlexDimension() has thrown an exception: " + b);
			a = undefined;
		}
		if (tactile.Enum.contains(tactile.Enum.Dimension, a)) {
			return a;
		} else {
			tactile.logger
					.error(this.id
							+ ".validFlexDimension - tactile.Enum.Dimension doesn't contains "
							+ a);
			a = undefined;
		}
	}
	return a;
};
tactile.FlexView.prototype.toString = function() {
	return "Object - tactile.FlexView";
};
tactile.FlexView.toString = function() {
	return "tactile.FlexView";
};
tactile.FlexItem = function(b, a) {
	a = a || {};
	if (a.position && tactile.Enum.contains(tactile.Enum.Position, a.position)) {
		a.position = tactile.Enum.getValue(tactile.Enum.Position, a.position);
	} else {
		a.position = tactile.Enum.Position.absolute;
	}
	if (a.parent) {
		if (a.parent instanceof tactile.FlexView === true) {
			this.parent = a.parent;
			if (!this.parent.flexitems.contains(this)) {
				this.parent.addItem(this);
			}
		} else {
			tactile.logger.error("Error - type mismatch: FlexItem " + this.id
					+ " expects parent of type FlexView!");
		}
	}
	tactile.FlexItem.prototype.init.call(this, b, a);
	this.onresize = new tactile.foundation.Observer();
	this.onstatechange = new tactile.foundation.Observer();
	this.aftershow = new tactile.foundation.Observer();
	this.beforeshow = new tactile.foundation.Observer();
	this.afterhide = new tactile.foundation.Observer();
	this.beforehide = new tactile.foundation.Observer();
	this.aftershow.subscribe(function(c) {
		this.update(this.getParentInnerBox());
	}, this);
	this.state = "initialized";
	this.beforehide.subscribe(function(c) {
		this.state = "hiding";
	}, this);
	this.afterhide.subscribe(function(c) {
		this.state = "hidden";
	}, this);
	this.afterhide.subscribe(function(c) {
		this.onstatechange.fire({
			sourceId : c.targetId
		});
	}, this);
	this.beforeshow.subscribe(function(c) {
		this.state = "showing";
	}, this);
	this.aftershow.subscribe(function(c) {
		this.state = "showed";
	}, this);
	this.aftershow.subscribe(function(c) {
		this.onstatechange.fire({
			sourceId : c.targetId
		});
	}, this);
};
tactile.FlexItem.prototype = new tactile.foundation.UIContainer();
tactile.FlexItem.prototype.update = function(b) {
	tactile.foundation.UIContainer.prototype.update.call(this, b);
	var a = this.getInnerBox();
	this.onresize.fire(a);
};
tactile.FlexItem.prototype.toString = function() {
	return "Object - tactile.FlexItem";
};
tactile.FlexItem.toString = function() {
	return "tactile.FlexItem";
};
tactile.FlexItem.cast = function(a) {
	return (a instanceof tactile.FlexItem) ? a : null;
};
tactile.Device = {
	platform : tactile.c.D.os.platform,
	version : tactile.c.D.os.version,
	isTouch : tactile.c.D.os.isTouch,
	defaults : {
		effectduration : tactile.c.D.os.platform === "android"
				&& tactile.c.D.os.version <= 2 ? 1000 : 800
	},
	browser : {
		name : tactile.c.D.browser.name,
		canCookie : tactile.c.D.browser.canCookie,
		cssanimations : tactile.c.D.browser.cssanimations,
		csstransitions : tactile.c.D.browser.csstransitions,
		csstransforms : tactile.c.D.browser.csstransforms,
		csstransforms3d : tactile.c.D.browser.csstransforms3d,
		borderradius : tactile.c.D.browser.borderradius,
		transitionEndEventType : function() {
			return tactile.c.D.browser.transitionEndEvent;
		},
		transitionEndEventSupported : function() {
			return tactile.c.D.browser.transitionEndEvent !== "";
		},
		style : {
			transitionProperty : tactile.c.D.browser.style.transitionProperty,
			transitionDuration : tactile.c.D.browser.style.transitionDuration,
			transitionTimingFunction : tactile.c.D.browser.style.transitionTimingFunction,
			transitionDelay : tactile.c.D.browser.style.transitionDelay,
			transformProperty : tactile.c.D.browser.style.transformProperty,
			perspectiveProperty : tactile.c.D.browser.style.perspectiveProperty,
			borderRadius : tactile.c.D.browser.style.borderRadius
		},
		prefixed : function(a) {
			return tactile.c.D.browser.cssprefix + a;
		}
	},
	screen : {
		getWidth : function() {
			return tactile.c.D.screen.getWidth();
		},
		getHeight : function() {
			return tactile.c.D.screen.getHeight();
		},
		isLandscape : function() {
			return tactile.c.D.screen.getWidth() > tactile.c.D.screen
					.getHeight();
		},
		isPortrait : function() {
			return tactile.c.D.screen.getHeight() > tactile.c.D.screen
					.getWidth();
		}
	}
};
tactile.EventManager = {
	addResizeListener : function(b, a) {
		if (!b) {
			throw "Error - tactile.EventManager. No listener function specified";
		}
		tactile.c.V.addResizeListener(b, a);
	},
	addDomReadyListener : function(a) {
		if (!a) {
			throw "Error - tactile.EventManager. No listener function specified for id: "
					+ id;
		}
		tactile.c.V.domReady.add(a);
	},
	addOnloadListener : function(a) {
		tactile.c.V.addListener(window, "load", a);
	},
	addUnloadListener : function(a) {
		tactile.c.V.addListener(window, "unload", a);
	},
	addListener : function(d, c, a) {
		if (!a) {
			throw 'Error - tactile.EventManager.addListener "' + c
					+ '". No listener function specified for id: ' + d;
		}
		var b = document.getElementById(d);
		if (!b) {
			tactile.logger
					.error("tactile.EventManager.addListener - No element found to add event "
							+ c + " for id: " + d);
			return;
		}
		if (tactile.events && tactile.events.TouchEventManager.isTouchEvent(c)) {
			tactile.events.TouchEventManager.addListener(b, c, a);
		} else {
			tactile.c.V.addManagedListener(b, c, a);
		}
	},
	addSecuredListener : function(d, c, b) {
		var a = function(g) {
			try {
				b.call(g);
			} catch (f) {
				tactile.logger
						.error("tactile.EventManager.addSecuredListener - " + f);
			}
		};
		tactile.EventManager.addListener(d, c, a);
	},
	removeListener : function(d, c, a) {
		if (!a) {
			throw 'Error - tactile.EventManager "' + c
					+ '". No listener function specified for id: ' + d;
		}
		var b = document.getElementById(d);
		if (!b) {
			tactile.logger
					.error("tactile.EventManager.removeListener - No element found to remove event "
							+ c + " for id: " + d);
			return;
		}
		if (tactile.events
				&& tactile.events.TouchEventManager.isTouchEvent(c) > 0) {
			tactile.events.TouchEventManager.removeListener(b, c, a);
		} else {
			tactile.c.V.removeManagedListener(b, c, a);
		}
	}
};
tactile.page = (function() {
	var a = function() {
		var d = new tactile.foundation.Observer();
		this.onready = function(e) {
			d.subscribe(e);
		};
		this.inits = [];
		var c = this;
		function b() {
			c.inits.forEach(function(e) {
				e.call(window);
			});
			c.init = function(e) {
				e.call(window);
			};
		}
		tactile.EventManager.addDomReadyListener(function() {
			b();
			tactile.c.D.screen.updateOrientation();
			d.fire();
			tactile.foundation.LayoutManager.init();
		});
		tactile.EventManager
				.addResizeListener(tactile.c.D.screen.updateOrientation);
	};
	a.prototype.getComponent = function(b) {
		if (tactile.foundation.UIComponent.components[b]) {
			return tactile.foundation.UIComponent.components[b];
		} else {
			var c = document.getElementById(b);
			if (c) {
				return new tactile.foundation.UIElement(c);
			} else {
				return null;
			}
		}
	};
	a.prototype.isComponent = function(b) {
		if (tactile.foundation.UIComponent.components[b]) {
			return true;
		} else {
			return false;
		}
	};
	a.prototype.init = function(b) {
		this.inits.push(b);
	};
	return new a();
})();